You are designing a quiz application where users can click on an option to choose their answer. To highlight the selected option and store the user's choice, you would use ________ to manage this local UI state.

  • useState
  • useRef
  • useReducer
  • useContext
To manage the local UI state in a quiz application where users can select answers, you would use the useState hook. useState allows you to create state variables that can hold the selected option and trigger UI updates when the user makes a choice. While useRef, useReducer, and useContext have their use cases, they are not the primary choice for managing local UI state in this scenario.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *