Skip to content

Instantly share code, notes, and snippets.

@sbalay
Last active January 26, 2017 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbalay/66cf961511f703e6c80a71698e4159a9 to your computer and use it in GitHub Desktop.
Save sbalay/66cf961511f703e6c80a71698e4159a9 to your computer and use it in GitHub Desktop.
React Native's TextInput wrapper to be used with redux-form
import React from 'react';
import { TextInput, View, Text } from 'react-native';
/**
* to be wrapped with redux-form Field component
*/
export default function MyTextInput(props) {
const { input, ...inputProps } = props;
return (
<View>
<TextInput
{...inputProps}
onChangeText={input.onChange}
onBlur={input.onBlur}
onFocus={input.onFocus}
value={input.value}
/>
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment