Skip to content

Commit

Permalink
Add defensive window.document check when checking for startViewTransi…
Browse files Browse the repository at this point in the history
…tion (#11544)

Co-authored-by: Nathan Rajlich <[email protected]>
  • Loading branch information
brophdawg11 and TooTallNate authored May 9, 2024
1 parent 9651465 commit 031478d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-donkeys-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-router-dom": patch
---

Check for `document` existence when checking `startViewTransition`
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
- tlinhart
- tom-sherman
- tomasr8
- TooTallNate
- triangularcube
- trungpv1601
- turansky
Expand Down
1 change: 1 addition & 0 deletions packages/react-router-dom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 031478d

Please sign in to comment.