Skip to content

Commit fa510af

Browse files
author
Zach Silveira
authored
Create README.md
1 parent 481309a commit fa510af

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# react-native-autofocus
2+
`npm install react-native-autofocus`
3+
4+
Autofocus the next input field on enter in React Native.
5+
6+
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:
7+
8+
```js
9+
import { Form, TextInput } from 'react-native-autofocus'
10+
11+
export default () => (
12+
<Form>
13+
<TextInput placeholder="test" />
14+
<TextInput placeholder="test 2" />
15+
</Form>
16+
)
17+
```
18+
19+
Hit enter inside your first input, and the next field will be focused. The logic is all abtracted for you!

0 commit comments

Comments
 (0)