Skip to content

Commit 2006460

Browse files
brophdawg11TooTallNate
authored andcommitted
Add defensive window.document check when checking for startViewTransition (remix-run#11544)
Co-authored-by: Nathan Rajlich <[email protected]>
1 parent 090e876 commit 2006460

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.changeset/good-donkeys-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router-dom": patch
3+
---
4+
5+
Check for `document` existence when checking `startViewTransition`

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@
242242
- tlinhart
243243
- tom-sherman
244244
- tomasr8
245+
- TooTallNate
245246
- triangularcube
246247
- trungpv1601
247248
- turansky

packages/react-router-dom/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ export function RouterProvider({
526526

527527
let isViewTransitionUnavailable =
528528
router.window == null ||
529+
router.window.document == null ||
529530
typeof router.window.document.startViewTransition !== "function";
530531

531532
// If this isn't a view transition or it's not available in this browser,

0 commit comments

Comments
 (0)