Put in order · JavaScript and React course · Module 9: Modern React Hooks

useId Syntax for Accessibility

Arrange the code of a component that connects a label with a field using useId:

Items to put in order

  • return <><label htmlFor={id}>Call sign</label>
  • <input id={id} /></>;
  • }
  • const id = useId();
  • function CallSignField() {

You can check the correct answer by solving this task in the CodeWorlds game.