create-prop-types
A lightweight helper library to create custom React prop types.
Getting started
Install
npm install create-prop-types --save-dev
Create a custom prop type
// ./prop-types/Iterable.js ;; const IterablePropType = ; ;
Use the custom prop type
import Iterable from './prop-types/Iterable'; Component static propTypes = propA: Iterable propB: IterableisRequired
API
predicate: (propValue: any) => boolean
A predicate function to satisfy in order to consider the prop value as valid.
Example
const CustomPropType = ; ;
warnings?: Warnings
Optional custom warning messages.
Example
const CustomPropType = ; ;
License
This project is licensed under MIT License. See the license file for more details.