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

Invalid initial value for "online" state in use-network hook (mantinedev#3177) #3178

Merged
merged 2 commits into from Dec 17, 2022

Conversation

Sajarin-M
Copy link
Contributor

No description provided.

@rtivital
Copy link
Member

This change will cause hydration mismatch if used with ssr.

@Sajarin-M
Copy link
Contributor Author

Sajarin-M commented Dec 13, 2022

This change will cause hydration mismatch if used with ssr.

Is there any other way to fix this?

@rtivital
Copy link
Member

No

@Sajarin-M
Copy link
Contributor Author

does using navigator.onLine in the useEffect also cause a hydration mismatch ?

@rtivital
Copy link
Member

No, it does not cause it, component rerenders on client.

@Sajarin-M
Copy link
Contributor Author

then we can update it to correct state on rerender

@rtivital rtivital merged commit 5b1b67c into mantinedev:master Dec 17, 2022
@rtivital
Copy link
Member

Thanks!

@Sajarin-M Sajarin-M deleted the fix/use-network-initial-state branch March 26, 2023 09:40
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.

None yet

2 participants