https://github.com/zackify/react-native-autofocus
Autofocus the next input field on enter in React Native
https://github.com/zackify/react-native-autofocus
Last synced: 8 months ago
JSON representation
Autofocus the next input field on enter in React Native
- Host: GitHub
- URL: https://github.com/zackify/react-native-autofocus
- Owner: zackify
- Created: 2017-07-30T21:46:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-15T14:55:35.000Z (over 7 years ago)
- Last Synced: 2025-06-06T08:04:56.384Z (9 months ago)
- Language: JavaScript
- Homepage: https://zach.codes/autofocus-inputs-in-react-native/
- Size: 11.7 KB
- Stars: 86
- Watchers: 6
- Forks: 11
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-autofocus
`npm install react-native-autofocus`
Autofocus the next input field on enter in React Native.
Have you started with React Native, added a few inputs, and then realized you had to add refs just to focus onto the next input field? This little package solves that problem. Import your text input from this library and wrap them in a form:
```js
import { Form, TextInput } from 'react-native-autofocus'
export default () => (
)
```
Hit enter inside your first input, and the next field will be focused. The logic is all abstracted for you!