-
- Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Labels
Description
What version of React Router are you using?
6.3.0 (but also still present in later versions)
Steps to Reproduce
Open any react-router-dom page which includes <ScrollRestoration />
in a browser which has blocked access to sessionStorage
(e.g. running inside a sandboxed cross-origin iframe, or more easy to reproduce: block all cookies in Chrome)

Expected Behavior
This setItem call should be wrapped in a try/catch so that permissions issues do not reach the console.
Clearly the functionality won't work in this situation, but it should fail gracefully, rather than printing an error to the console.
Actual Behavior
Error in console:
Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.