I have propType expressions that sometimes are emitting warnings.
When that happens, I would like to inspect the object causing the warning since the warning message in the console is in same cases not helpful enough.
I tried to debugging through the spec code of react to find the right spot for the breakpoint, however i would expect there is an easier way to get more diagnostic information about the warning.
As of React v15. 5 PropTypes are deprecated in the React package and have been given a package of their own. Change is an inevitable part of life.
PropTypes are simply a mechanism that ensures that the passed value is of the correct datatype. This makes sure that we don't receive an error at the very end of our app by the console which might not be easy to deal with.
Want the ugly solution? Because that's all I have.
Stick this in your main application file.
const error = console.error;
console.error = (...args) => {
debugger;
error.apply(null, args);
}
And use the debugger to walk up the callchain till you find checkReactTypeSpec
and look at its arguments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With