is-component-of-type

v1.0.1arrow_drop_down
v1.0.1
v1.0.0
STATUS
Passing
DOWNLOADS
10
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
6 years ago
SIZE
479 B
Returns true if the provided element is a component of the provided type.
1 contributor
Install is-component-of-type as a package?
Copied
npm i @bit/tomlandau.belle.utils.is-component-of-type
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
utils/isComponentOfType (
classType,
reactElement
)

Returns true if the provided element is a component of the provided type.

Example
// Checks if the component is an Autocomplete
isComponentType(Autocomplete, this.props.children[0]);
Arguments
classType

{ReactElement class} - the class of a React Element

reactElement

{ReactElement} - any React Element (not a real DOM node)

Help and resources