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: stop useNetworkConnectivity from causing hydration errors. #255

Conversation

martin-wahlberg
Copy link
Contributor

Description:

We encountered hydration errors like:

Error: Hydration failed because the initial UI does not match what was rendered on the server.

Solution:

The issue was resolved by rewriting the hook to use useSyncExternalStorage, ensuring consistency between server and client rendering.

Request for Review:

The change has been tested and eliminates the hydration errors. Looking forward to your feedback and hoping for a quick merge.

ShafSpecs and others added 7 commits August 11, 2024 08:33
Multiple fixes + SPA minimal mode
## @remix-pwa/cli 1.2.5 (2024-08-11)

### Bug Fixes

* **cli:** added new `--dev` flag to the `upgrade` command - for updating to latest `dev` candidate d4f4414
# @remix-pwa/dev 3.1.0 (2024-08-11)

### Bug Fixes

* **dev:** pre-rc-candidate: adding (minimal) global support for Remix SPA mode a035c49

### Features

* **dev:** added injectable vars cac1206
## @remix-pwa/sw 3.0.9 (2024-08-11)

### Bug Fixes

* **sw:** added `matchOptions` for adding querying options to cache operations c87e507
## @remix-pwa/worker-runtime 2.1.4 (2024-08-11)

### Bug Fixes

* **worker-runtime:** added minimal support for runtimes in Remix SPA mode 6dd95e6
## @remix-pwa/sync 3.0.4 (2024-08-11)

### Dependencies

* **@remix-pwa/sw:** upgraded to 3.0.9
@martin-wahlberg martin-wahlberg changed the base branch from main to dev August 23, 2024 13:59
@martin-wahlberg
Copy link
Contributor Author

@ShafSpecs are you able to have a look at this?

@ShafSpecs
Copy link
Member

Sorry, just doing so. For some reason, I don't get emails about actions in this organization 🥲. I need to fix that, my bad

@ShafSpecs ShafSpecs merged commit dec144d into remix-pwa:dev Aug 23, 2024
4 of 5 checks passed
@ShafSpecs
Copy link
Member

After the merge, you can check out your fix by installing the dev version, either via: npm i @remix-pwa/sw@dev or npx remix-pwa upgrade -D -p sw.

Sorry, I'm not with my PC this week and can't check it out fully. Once I'm able to, I would push to latest. And thx for the PR ❤️!

@ShafSpecs
Copy link
Member

I mean client, just remembered the hook isn't in sw but the client package

@martin-wahlberg martin-wahlberg deleted the fix_hydration_errors_for_useNetworkConnectivity_hook branch September 1, 2024 21:07
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.

3 participants