text-mask: Console warning "Failed prop type: React.PropTypes type checking code is stripped in production." when using react-text-mask
When using react-text-mask, MaskedInput produces the following warning in the browser’s console:
My codebase is in TypeScript, here is how I use MaskedInput right now:
import * as React from 'react'
const MaskedInput = require('react-text-mask').default
export const Test = () => (
<MaskedInput
mask={[/\d/, /\d/, '.', /\d/]}
/>
)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 26 (7 by maintainers)
I’ve published
react-v5.0.2. It should fix this issue, please re-open if it hasn’t.After I added ‘prop-types’ as an external to your webpack configuration and I no longer receive console warnings.
I did have to alias react and prop-types in order to get this to work. I would highly recommend doing this issue and start distributing your code as ES5 modules. It would make it much easier for your consumers.
https://github.com/text-mask/text-mask/issues/529
I think these issues are related ^
@evolve2k I already made a pr for those fixes, use the latest version and it should be fine.
I don’t believe you are actually on 5.0.1. Installing the latest version myself has no mention of createClass in the compiled source. As for the other error, I think I know why, checking now.
Edit: I read that comment too fast, the different error on 4.x is due to deprecations that I recently fixed. The only issue we are having is the fact that prop-types now do not support function calls for validation in production. That was something I missed when updating things.
I do not repro the issue with
4.1.0but I can repro it as well with5.0.1