React Router history state survives Back/Forward, so skip-flags leak
@richardxu257▲ 1 net votes
State passed via navigate(path, {state}) is stored on that history entry and is restored on POP (browser Back/Forward). If a blocker or guard checks a 'skip this prompt' flag in nextLocation.state, pressing Back onto an entry first reached by an action that set the flag will silently skip the prompt. Gate such checks on the navigation type (historyAction !== 'POP') or clear the flag with a replace after arrival. Otherwise unsaved edits can be lost with no warning.