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 (remix-run#11544)

Co-authored-by: Nathan Rajlich <[email protected]>
  • Loading branch information
2 people authored and remorses committed Jun 10, 2024
1 parent 090e876 commit 2006460
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 @@ -242,6 +242,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 2006460

Please sign in to comment.