Skip to content

A simple react-native component to wrap your form fields and get their values with just one single method.

License

Notifications You must be signed in to change notification settings

novom/react-native-form

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

react-native-form

A simple react-native component to wrap your form fields and get their values without attaching listeners everywhere.

Advantages:

  • You'll avoid to track values by your own;
  • <Form> tracks all known components for you, doesn't matter how deep they're;
  • Exposes a simple API to retrieve the value.

### How to install? `npm install react-native-form` and voilà!
### How to use? Just put how many react-native components (fields) you want inside ``, with the prop `name` defined. And that's it.
var Form = require('react-native-form')

<Form ref="example">
  <TextInput name="lala" />
  <SwitchAndroid name="lele" />
  <SwitchIOS name="lili" />
  <SliderIOS name="lolo" />
  <PickerIOS name="lulu" />
  <DatePickerIOS name="lululu" />
</Form>

Now you can get the form value by calling this.refs.example.getValues()


### License react-native-form is licensed under the [MIT license](LICENSE).

About

A simple react-native component to wrap your form fields and get their values with just one single method.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%