Skip to content
Autofocus the next input field on enter in React Native
Branch: master
Clone or download
Latest commit 6ae1955 Jun 28, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information. Update Aug 1, 2017
form.js Check for null and undefined Jun 28, 2018
index.js First push Jul 30, 2017
package-lock.json Update version for recusrive children fix Sep 8, 2017
package.json Release new version Jun 28, 2018
text-input.js First push Jul 30, 2017


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:

import { Form, TextInput } from 'react-native-autofocus'

export default () => (
    <TextInput placeholder="test" />
    <TextInput placeholder="test 2" />

Hit enter inside your first input, and the next field will be focused. The logic is all abstracted for you!

You can’t perform that action at this time.