introspectable-proptypes
v15.6.2
Published
Hacky propTypes introspection wrapper
Downloads
3
Readme
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-proptypes
ornpm install introspectable-proptypes
- Import component:
import PropTypes from "introspectable-proptypes";
- Use as before.
- Introspect:
MyComponent.propTypes.introspection
now contains a readable version of the propType.