Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-router,start): ensure document is only used when available #2120

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

lo1tuma
Copy link
Contributor

@lo1tuma lo1tuma commented Aug 12, 2024

I’m trying to use react-test-renderer to render a component that uses router hooks or components like Meta. It seems like react-test-renderer is always executing useLayoutEffect and useEffect. Since I don’t have a global window or document object during my test run, some components fail when using document without checking if it exist.

See also discussion #2109.

@lo1tuma lo1tuma force-pushed the check-document branch 3 times, most recently from 9921b26 to 3ab6098 Compare August 12, 2024 15:14
Copy link

nx-cloud bot commented Aug 13, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 3da769a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

Copy link

pkg-pr-new bot commented Aug 13, 2024

commit: 3da769a

@tanstack/history

pnpm add https://pkg.pr.new/@tanstack/history@2120

@tanstack/react-cross-context

pnpm add https://pkg.pr.new/@tanstack/react-cross-context@2120

@tanstack/react-router

pnpm add https://pkg.pr.new/@tanstack/react-router@2120

@tanstack/react-router-with-query

pnpm add https://pkg.pr.new/@tanstack/react-router-with-query@2120

@tanstack/router-arktype-adapter

pnpm add https://pkg.pr.new/@tanstack/router-arktype-adapter@2120

@tanstack/router-cli

pnpm add https://pkg.pr.new/@tanstack/router-cli@2120

@tanstack/router-devtools

pnpm add https://pkg.pr.new/@tanstack/router-devtools@2120

@tanstack/router-generator

pnpm add https://pkg.pr.new/@tanstack/router-generator@2120

@tanstack/router-plugin

pnpm add https://pkg.pr.new/@tanstack/router-plugin@2120

@tanstack/router-valibot-adapter

pnpm add https://pkg.pr.new/@tanstack/router-valibot-adapter@2120

@tanstack/router-vite-plugin

pnpm add https://pkg.pr.new/@tanstack/router-vite-plugin@2120

@tanstack/router-zod-adapter

pnpm add https://pkg.pr.new/@tanstack/router-zod-adapter@2120

@tanstack/start

pnpm add https://pkg.pr.new/@tanstack/start@2120

@tanstack/start-vite-plugin

pnpm add https://pkg.pr.new/@tanstack/start-vite-plugin@2120

Open in Stackblitz

More templates

packages/react-router/src/Transitioner.tsx Outdated Show resolved Hide resolved
packages/start/src/client/Meta.tsx Outdated Show resolved Hide resolved
packages/start/src/client/Meta.tsx Outdated Show resolved Hide resolved
@lo1tuma
Copy link
Contributor Author

lo1tuma commented Aug 19, 2024

@SeanCassiere thanks for the review. I’ve addressed all comments so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants