Skip to content

Instantly share code, notes, and snippets.

@tonysaffo
Created January 24, 2019 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonysaffo/9327940dca6062ed49bb79d2f25e8975 to your computer and use it in GitHub Desktop.
Save tonysaffo/9327940dca6062ed49bb79d2f25e8975 to your computer and use it in GitHub Desktop.
Phone Mask React
<IMaskInput
name='phone'
mask='+{7} (000) 000-00-00'
radix="."
value={this.state.phone}
unmask="true" // true|false|'typed'
onAccept={
// depending on prop above first argument is
// `value` if `unmask=false`,
// `unmaskedValue` if `unmask=true`,
// `typedValue` if `unmask='typed'`
(value, mask) => this.onChangeInputMask(value)
}
// ...and more mask props in a guide
// input props also available
placeholder='Телефон'
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment