You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vinibiavatti1 edited this page Sep 28, 2026
·
2 revisions
Generates unique IDs that are stable across server and client renders. It avoids hydration mismatches in SSR applications and is primarily used for linking accessibility attributes (aria-describedby, htmlFor, etc.) to HTML elements.
import{useId}from'react';// The generated ID is always deterministic and safeexportconstMyComponent=()=>{constid=useId();return(<><labelhtmlFor={id}>Name</label><inputid={id}/></>);};