Question · JavaScript and React course · Module 6: React Router

Reading location state

Which hook would you use to read data passed through location state?

Answer options

  • useParams()
  • useNavigate()
  • useLocation()
  • useSearchParams()

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