Permalink
Browse files

Update react-native.md (#1234)

  • Loading branch information...
YikSanChan authored and jaredpalmer committed Jan 11, 2019
1 parent 35d7158 commit e16279d748f162e9af32f60c333da494cb5e40ff
Showing with 1 addition and 1 deletion.
  1. +1 −1 docs/guides/react-native.md
@@ -45,4 +45,4 @@ DOM and React Native are:
1. Formik's `props.handleSubmit` is passed to a `<Button onPress={...} />`
instead of HTML `<form onSubmit={...} />` component (since there is no
`<form />` element in React Native).
2. `<TextInput />` uses Formik's `props.handleChange(fieldName)` and `handleBlur(fieldName)` instead of directly assigning the callbacks to props, because we have to get the `fieldName` from somewhere and with ReactNative we can't get it automatically like for web (using input name attribute). You can also use `setFieldValue(fieldName, value)` and `setFieldTouched(fieldName, bool)` as an alternative.
2. `<TextInput />` uses Formik's `props.handleChange(fieldName)` and `handleBlur(fieldName)` instead of directly assigning the callbacks to props, because we have to get the `fieldName` from somewhere and with React Native we can't get it automatically like in web (using input name attribute). You can also use `setFieldValue(fieldName, value)` and `setFieldTouched(fieldName, bool)` as an alternative.

0 comments on commit e16279d

Please sign in to comment.