sgnh / react-children-proptype

This is a simple package for validating React children

Home Page:https://www.npmjs.com/package/react-children-proptype

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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,
};

About

This is a simple package for validating React children

https://www.npmjs.com/package/react-children-proptype

License:MIT License


Languages

Language:JavaScript 100.0%