HIDE PLAYLIST
1
Download in HD10s25s

Intercept Route Changes with React Router v4 Prompt Component


If a user has entered some input, or the current Route is in a “dirty” state and we want to confirm that data will be lost, React Router v4 provides a Prompt component to interrupt the Route transition and ask the user a question.

Find the code for this lesson on Github

The branch name corresponds to the lesson.

FIND THE CODE ON GITHUB