returnKeyType for all input fields?

813 Views Asked by At

How to set returnKeyType to all TextInput fields inside one application?

I'm currently using tcomb-form-native and have to define returnKeyType again for every field, I just want to define it once and should work in every component.

any ideas?

1

There are 1 best solutions below

1
On BEST ANSWER

You have a couple good options

  1. Create a custom text input component, and here you can create a stylised TextInput field for use across your entire application. You can then set returnKeyType=whatever in its props, and use this component for all your text input instead.
  2. Use react-native-global-props, which seems to have been created for this exact purpose. Here is the link to the repository for more information / instruction