diff --git a/.changeset/good-donkeys-kiss.md b/.changeset/good-donkeys-kiss.md new file mode 100644 index 0000000000..15be073c5d --- /dev/null +++ b/.changeset/good-donkeys-kiss.md @@ -0,0 +1,5 @@ +--- +"react-router-dom": patch +--- + +Check for `document` existence when checking `startViewTransition` diff --git a/contributors.yml b/contributors.yml index a2aab00d2e..d3c533fac1 100644 --- a/contributors.yml +++ b/contributors.yml @@ -241,6 +241,7 @@ - tlinhart - tom-sherman - tomasr8 +- TooTallNate - triangularcube - trungpv1601 - turansky diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index 1d4675396e..1f2e515f75 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -526,6 +526,7 @@ export function RouterProvider({ let isViewTransitionUnavailable = router.window == null || + router.window.document == null || typeof router.window.document.startViewTransition !== "function"; // If this isn't a view transition or it's not available in this browser,