Click in order · JavaScript and React course · Module 6: React Router
Programmatic navigation
Arrange the programmatic navigation with state:
Items to click
- const handleMissionComplete = () => {
- const navigate = useNavigate();
- };
- state: { missionCompleted: true }, replace: true });
- navigate('/space-station', {
You can check the correct answer by solving this task in the CodeWorlds game.