zbycz / osmapp

Lets make a universal app for OpenStreetMap
https://osmapp.org
GNU General Public License v3.0
211 stars 18 forks source link

Hydration error on mobile #690

Open Dlurak opened 2 days ago

Dlurak commented 2 days ago

When the feature panel uses the mobile drawer it generates a hydration error. I already fixed it once here: https://github.com/zbycz/osmapp/pull/555#discussion_r1791579609 The problem is that on the server it is always rendered as a feature panel on side and then the initial render on mobile renders it as the mobile drawer which leads to a hydration error.

zbycz commented 1 day ago

Since we need to maintain the server-side-rendering to allow search engines to index, we need to leave it rendering. The proper solution to remove the warning would be to set the mobileMode variable to false intially and only change it to true in browser on useEffect.