-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 r10 tabs test #2702
Fix r10 tabs test #2702
Conversation
🟢 No significant changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the tests but I'm worried that this is just fixing a symptom rather than a root cause. I'm curious about why we need that setTimeout call in the first place - and why only in development mode?
Some folks appear to be having problems on the initial render - see the comment on the original issue and https://discourse.shopify.io/t/reloading-ssr-application-causes-polaris-tabs-to-load-differently/6389.
Perhaps the measurement handling should be done with a useLayoutEffect rather than useEffect? (which will need to be wrapped in some custom hook because it doesn't play nice with SSR)
I'm not sure. IIRC at one point in time, styles loading was delayed. Just a shot in the dark but they may have been needed for measuring.
@dleroux Mentioned we've had this issue for a while, so I don't think it's related to the react bump.
If we do need to delay measurements, in production that would be the way to go 👍 However I don't think that'll fix the test. React uses |
For reference plus created an issue #2706 |
153c80b
to
67b2b42
Compare
WHY are these changes introduced?
Fixes #2694
WHAT is this pull request doing?
Removing the
setTimeout
mockHow to 🎩
git reset HEAD~2 --hard
dev up # or yarn install
yarn test TabMeasurer