Skip to content

sgnh/react-children-proptype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-children-proptype

This is a simple package for validating React children.

Installation

npm install --save react-children-proptype

Example

import childrenPropType from 'react-children-proptype';

const MyComponent = ({children}) => (
  <div>
    <h1>My Component</h1>
    {children}
  </div>
);

MyComponent.propTypes = {
  children: childrenPropType,
};