Modules: app/util/proptypes/childrenOfType

Methods


childrenOfType(components)

Returns a propType checker that checks if the passed children are of one of the provided component types.

Parameters:
Name Type Description
components Array

An array of React components which are allowed

Source:
Example
MyComponent.propTypes = {
  children: childrenOfType([SomeComponent, SomeOtherComponent]),
}