Date: 2023-03-10
Accepted
When using the app in development mode, the console is filled with hydration warnings. This usually is because the server and client render different content.
In this case however the error stems from a change in the DOM specification which aims to reduce attack vectors by removing the nonce attribute from elements.
This inadvertently causes differences between the server and the client side and React freaks out.
There is an outstanding issue to look into the problem.
We had a solution for this that was taken from a stackoverflow post.
This solution worked, but it seemed to be introducing a lot of "magic" to mask the problem.
After some discussion, we decided to do the same thing Remix does and suppress the warnings at the script level without any additional magic.
- We will no longer see hydration warnings in development mode.
- We have to keep an eye on the React issue to see if they come up with a better solution.