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

useNavigate with a number

What does calling navigate(-1) do in React Router?

Answer options

  • Navigates to the page at index -1
  • Goes back one page in the browser history
  • Removes the last entry from the history
  • Redirects to the error page

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