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

check for import.meta.env.SSR instead of import.meta.env.DEV to know… #409

Conversation

YassineBenh
Copy link
Contributor

… if CSR should hydrateRoot or createRoot

I had a bug when running inertia SSR with React.
It rendered the app two times because of the check on the import.meta.env.DEV, leading to a call to createRoot instead of hydrateRoot in the app.jsx file.

The fix now checks for the value of import.meta.env.SSR, provided by Vite.

@YassineBenh YassineBenh changed the title check for !import.meta.env.SSR instead of import.meta.env.DEV to know… check for import.meta.env.SSR instead of import.meta.env.DEV to know… Sep 9, 2024
@taylorotwell taylorotwell merged commit 2bdef9f into laravel:2.x Sep 11, 2024
16 checks passed
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