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
Banner and FilterControl break React hydration #1283
Comments
Thanks for bringing this up @GoodForOneFare. I'll have a look in the next day or two. |
We probably just need to remove the ID from Banner as it's not used for any accessibility enhancements. |
|
This issue has been inactive for 180 days and labeled with |
Reopening this as SSR discrepancies are still an issue |
ping @yourpalsonja, it'd be good for the backlog buddies to take a look at this and #1046 |
Hi, I'm seeing a similar issue with ResourceList. The 'Showing x items' title is missing. The promoted action is also missing when configured.
Are you using the React components? (Y/N): Y Server side rendering: Y When I disable SSR for this scenario, the console error disappears but the title and buttons remain missing. |
Probot. Stop that. |
This issue has been inactive for 180 days and labeled with |
Still haven't found the time to polish this off. Waiting for the next version of react and replacing our useUniqueId hook with Components that don't yet use useUniqueId are tracked in #1995 |
Actually, gonna close this as a duplicate of #1761 as that's got a more up-to-date state of the world |
Issue summary
I've had to disable some SSR in an internal Shopify project because a couple of Polaris components don't have consistent IDs between server / client.
Banner
's unique ID helper is defined at module scope, and never resets on the server side: https://github.com/Shopify/polaris-react/blob/9aa2768d29d9548ac88728580340bfa42b8b7e1f/src/components/Banner/Banner.tsx#L182-L185TextField
's id factory can be overridden, but FilterControl doesn't give callers control over this: https://github.com/Shopify/polaris-react/blob/9aa2768d29d9548ac88728580340bfa42b8b7e1f/src/components/ResourceList/components/FilterControl/FilterControl.tsx#L95-L110Expected behavior
FilterControl
->TextArea
(or make everything magically work 😄)Actual behavior
Banners and ResourcesLists rendered server side hydrate properly on the first load after server startup. Then fail to hydrate on every other page load.
Steps to reproduce the problem
Message me, and I'll describe how to get an internal project into this state.
Reduced test case
N/A because this needs a server.
Specifications
The text was updated successfully, but these errors were encountered: