rn-input-mask
v3.2.3
Published
Text input mask for React Native.
Downloads
9
Maintainers
Readme
rn-input-mask
Text input mask for React Native on iOS and Android. (forked from https://github.com/react-native-community/react-native-text-input-mask)
Setup
npm install --save rn-input-mask
# --- or ---
yarn add rn-input-mask
Usage
import TextInputMask from 'rn-input-mask';
...
<TextInputMask
onChangeText={(formatted, extracted) => {
console.log(formatted) // +1 (123) 456-78-90
console.log(extracted) // 1234567890
}}
mask={"+1 ([000]) [000] [00] [00]"}
/>
...
Testing
Jest
Make sure to mock the following to jest.setup.js
:
jest.mock('кт-input-mask', () => ({
default: jest.fn()
}));
More info
RedMadRobot Input Mask Android
Versioning
This project uses semantic versioning: MAJOR.MINOR.PATCH. This means that releases within the same MAJOR version are always backwards compatible. For more info see semver.org.
Local Development and testing
To use a local copy with your project, it's highly recommended to use https://github.com/wix/wml