Simple web like forms in react native.
Features | Installation | Usage
-
Simple: Merlin aims to mimic the functionality of web forms, just wrap your inputs in a
<Form>
tag, add an onSubmit and any inputs you want to track. -
Built in Validation: Built in support for basic validation with the option to extend it with your own and overwrite any error messages.
$ yarn add react-native-merlin
import { Form } from 'react-native-merlin'
const ExampleScreen = () => {
return (
<Form
onSubmit={({values, errors, isValid}) => {
if (isValid) {
console.log(values);
} else {
console.log(errors)
}
}}
>
<TextInput name="username" />
<TextInput name="password" required secureTextEntry={true} />
<Button title="Submit" type="submit">
</Form>
)
}