useLayoutEffect()
Pitfall
useLayoutEffect can hurt performance. Prefer useEffect when possible.
useID()
useID()is a React Hook for generating unique IDs that can be passed to accessibility attributes.- Call useId at the top level of your component to generate a unique ID.
- You can’t call it inside loops or conditions.
useIdshould not be used to generate keys in a list.
const id = useId();