Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

jacobbuck/react-component-of

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚨 Deprecated

This project is no longer being maintained. I'd recommend using childrenOfType from the airbnb-prop-types package instead.

react-component-of

Custom prop type validator for checking React component types.

Example

import componentOf from 'react-component-of';
import Button from './Button';

const ButtonGroup = ({children}) => (
	<div className="ButtonGroup">
		{children}
	</div>
);

ButtonGroup.propTypes = {
  children: componentOf([Button]).isRequired
};

export default ButtonGroup;