polaris
polaris copied to clipboard
Getting useLayoutEffect errors in SSR in Remix with the Remix Shopify App Template
https://github.com/Shopify/polaris/blob/a89e61478fb7c5f588021e542101aba8a3898ec8/polaris-react/src/components/IndexTable/IndexTable.tsx#L7-L8
I checked the line here 👆🏻, Maybe better to go back to use useIsomorphicLayoutEffect
being required everywhere ?
Same problem here updated to last version using IndexTable with Remix.
"@shopify/polaris": "^13.0.0",
Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes. 09:50:55 │ remix │ at IndexTableBase
cc @jesstelford it looks like it might have been you that changed from useIsomorphicLayoutEffect
to useLayoutEffect
here. Do you have a bit of time to investigate?
Any update on this ?
Thanks for the report folks, the error messages & prior investigation made it much easier to track down!
I've got a fix open in #11950 👍
The fix will be shipped in the following release: https://github.com/Shopify/polaris/pull/11997