1.1.0 • Published 3 years ago
@billogram/use-auto-focus v1.1.0
@billogram/use-auto-focus
A React hook for performing auto-focus on initial render
Install
yarn add @billogram/use-auto-focus
Usage
import useAutoFocus from '@billogram/use-auto-focus';
useAutoFocus
const node = React.useRef<HTMLInputElement>(null);
useAutoFocus<HTMLLabelElement>(node, true);
Note
This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. We probably won't take your feature requests unless they align with our own needs.
License
MIT