15.6.2 • Published 8 years ago
introspectable-proptypes v15.6.2
Introspectable PropTypes
Hacky thin wrapper to add introspection to React prop-types
This is a very thin layer around the prop-types package, to add introspection support, by setting a field called introspection on all created propTypes. This only handles the prop-types package. If you are using other packages (like react-immutable-proptypes), those must also be replaced.
Usage
- Add as dependency:
yarn add introspectable-proptypesornpm install introspectable-proptypes - Import component:
import PropTypes from "introspectable-proptypes"; - Use as before.
- Introspect:
MyComponent.propTypes.introspectionnow contains a readable version of the propType.