Skip to content

fix: React StrictMode breaking Inertia Head #2328

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

Merged
merged 6 commits into from
Jun 13, 2025

Conversation

jordanhavard
Copy link
Contributor

This PR addresses an issue where the page title would temporarily disappear when using React's Strict Mode, which caused components to mount/unmount/remount during development.
The issue occurred because the provider was being disconnected during Strict Mode's temporary unmount phase. We've fixed this by:

  1. Adding a reconnect() function to the head manager that allows providers to be restored
  2. Calling reconnect() in the component's effect
  3. Updating the dependency array to include the children prop, ensuring content updates properly

Fixes #2253

@pascalbaljet
Copy link
Contributor

Thanks!

@pascalbaljet pascalbaljet merged commit b259aad into inertiajs:master Jun 13, 2025
6 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.

React StrictMode breaks Inertia Head functionality.
2 participants