Hi there, I have a use case where I want to use prop-types to validate that json data coming from the backend api is passing into my component properly, this helps me to highlight bugs and inconsistencies between the api and what I expect in the front-end early.
But as I can see, prop-types is completely shimmed when node env is set to production. This works for me during development with test environments, but not when I push the code into my built test environment and want to monitor irregularities.
I want to understand if the reason for this is that it can cause a major performance impact otherwise? Or if not, is there a possibility the propTypes.checkPropTypes can be enhanced with a param to run in production on a case by case basis?
Or if not maybe there's another library that already does what I'm describing and I'm not aware of it 🤔
Hi there, I have a use case where I want to use prop-types to validate that json data coming from the backend api is passing into my component properly, this helps me to highlight bugs and inconsistencies between the api and what I expect in the front-end early.
But as I can see, prop-types is completely shimmed when node env is set to
production
. This works for me during development with test environments, but not when I push the code into my built test environment and want to monitor irregularities.I want to understand if the reason for this is that it can cause a major performance impact otherwise? Or if not, is there a possibility the
propTypes.checkPropTypes
can be enhanced with a param to run in production on a case by case basis?Or if not maybe there's another library that already does what I'm describing and I'm not aware of it 🤔
Thanks!