@nosocks/propertypes
v1.0.2
Published
<br /> <p align="center"> <h2 align="center">propertypes</h2> <p align="center"> An extension to React prop-types package but with props info you can read from imported components. </p> <br />
Downloads
5
Readme
About The Project
To get a local copy up and running follow these simple steps.
Required dependencies
prop-types: ^15.7.2
react: ^17.0.2
Usage
Use this package instead of prop-types
:
// Component.jsx
import Proptypes, { string } from 'propertypes'
Component.propTypes = {
x: string
}
// Other
Component.propTypes.x.info.type === 'string'
Know Issues
- There is no way to check if a prop is required, I'm currently fixing this.
License
Distributed under the MIT License. See LICENSE
for more information.