Package Exports
- react-props-monitor
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-props-monitor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-props-monitor
In-depth review props in any React app.
Install
yarn add -D react-props-monitoror
npm install --save-dev react-props-monitorUsage
import React from 'react';
import initPropsMonitor, { PropsMonitor } from 'react-props-monitor';
initPropsMonitor(React);
/../
render() {
return (
<div>
<Root />
<PropsMonitor />
</div>
);
}
ctrl+i to open a monitor.

Catch error of validation
PropTypes
PropsMonitor displays exactly which props caused the error on based PropTypes of component.
Custom validation function
You can define any validation function for props, based on prevProps, nextProps and name of component.
const titleIsVerySmallNumber = ({ nextProps }) => {
if (nextProps.title < 2000000)
return 'Caution your title prop is small a number.';
return false;
};
const titleShouldIncrease = ({ prevProps, nextProps, name }) => {
if (name === 'TextBox' && prevProps && prevProps.title > nextProps.title)
return 'Hey dude, I think you must to increase your title.';
return false;
};
const validationFns = [
titleIsVerySmallNumber,
titleShouldIncrease,
];
/../
render() {
return (
<div>
<Root />
<PropsMonitor validation={validationFns} />
</div>
);
}
Coming soon
- define and lock props
- forecast for types based on real props in runtime