rn-use-input-focus
v1.0.1
Published
A React Native hook that makes it easier to use focus in inputs.
Downloads
23
Maintainers
Readme
Usage
import useInputFocus from "rn-use-input-focus";
const App = () => {
const [inputRefs, focus] = useInputFocus(["email", "password"]);
return (
<View>
<TextInput onSubmitEditing={() => focus("email")} placeholder="Name" />
<TextInput
ref={inputRefs.email}
onSubmitEditing={() => focus("password")}
placeholder="Email"
/>
<TextInput ref={inputRefs.password} placeholder="Password" />
</View>
);
};