Synopsis
joi-react is a tiny wrapper to convert joi schemas into React PropType validators.
Install
Node.js
With NPM
npm install joi-react
From source
git clone https://github.com/foss-haas/joi-react.gitcd joi-reactnpm installnpm run test && npm run dist
API
joiToPropType(joiSchema):Function
Takes a joi schema and returns a React PropType.
Example:
var joi = ;var joiToPropType = ;var React = ;var starsSchema = joi;var starsPropType = ; var Rating = React; React;// -> Warning: value is requiredReact;// -> Warning: value must be larger than or equal to 1React;// -> Warning: value must be less than or equal to 5React;// no warnings
License
The MIT/Expat license. For more information, see http://foss-haas.mit-license.org/ or the accompanying LICENSE file.