@billogram/use-auto-focus

A React hook for performing auto-focus on initial render

Usage no npm install needed!

<script type="module">
  import billogramUseAutoFocus from 'https://cdn.skypack.dev/@billogram/use-auto-focus';
</script>

README

@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