Closed maksugr closed 6 years ago
Anybody here? Can I somehow use mask for any symbol?)
@maksugr yes, it checks if a mask prop is available – https://github.com/react-native-community/react-native-text-input-mask/blob/master/index.js#L23, so you can use TextInputMask
like a TextInput
without mask features. Let me know if it doesn't work :)
@ivanzotov I get a crash in Android if I do not pass a mask. I think there's a null check missing.
@kirakik thanks, reopened issue, will fix
@ivanzotov yes, I had the same issue. sorry for non informative first message.
@maksugr a work around for now would be to create a component that renders a text input, and pass it a mask
prop when you need it. Then in the rendering of that component, you can do:
const Input = this.props.mask ? TextInputMask : TextInput
return (
<Input {...} />
)
@kirakik yes, this way is good and work, but not for me. I also wrap components in styled-components and my logic is more complicated then this, and it doesn't work without additional hacks. So I want TextInputMask that works without mask prop by default.
@maksugr fixed in 0.6.2
i still get the same non-null error....
Can I use
TextInputMask
but withundefined
or some other value of property mask (any character)? It's comfortable to use this component with mask and without.