Skip to content

useId

Uses React 18's built-in useId() when available, or falls back to a slightly less performant (requiring a double render) implementation for earlier React versions.

import {useId} from '@floating-ui/react-dom-interactions';
 
// ...
const id = useId();

This does not get passed to useInteractions().