Reputation:
There is an example of Formatted inputs from material-ui docs https://stackblitz.com/edit/mfj4la
How to pass mask value [/\d/, /\d/, /\d/, /\d/, /\d/, /\d/, /\d/, /\d/]
to the TextMaskCustom component from parent component?
Upvotes: 10
Views: 9572
Reputation:
Custom props can be passed to the TextMaskCustom using inputProps
<FormControl>
<InputLabel>react-text-mask</InputLabel>
<Input
value={textmask}
onChange={this.handleChange('textmask')}
inputComponent={TextMaskCustom}
inputProps={{
mask: [/\d/, /\d/, /\d/, /\d/, /\d/, /\d/, /\d/, /\d/]
}}
/>
</FormControl>
Upvotes: 20