react-native-input-validation
v1.2.2
Published
Simple customizable text input which can validate its content
Downloads
72
Maintainers
Readme
Installation
Using npm: npm i -S react-native-input-validation
Using yarn: yarn add react-native-input-validation
Quick Start
First import InputValidation from 'react-native-input-validation
Then simply use it in your component like this:
<InputValidation validator="email" onValidatorExecuted={isValid => console.log(isValid)} validatorExecutionDelay={100}/>
This will display a text input. When you type, the "email" validator (already defined in the component) will be tested with the input value after 100ms, then it will trigger the onValidatorExecuted callback, passing the validity of the input.
Run the example
cd example
npm install
oryarn
react-native run-ios
orreact-native run-android
Props and methods
The input accepts every props from TextInput component.
Props
Methods
Contributing
If you have any problem, leave an issue here
If you want to add a feature of fix a bug, leave a pull request.