Today I Learned
TIL: React useId hook
react til
Use useId for accessible form labels.
function Input({ label }) {
const id = useId();
return (
<>
<label htmlFor={id}>{label}</label>
<input id={id} />
</>
);
}
Generates stable IDs that work with SSR.