Skip to content
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

✨useIsomorphicLayoutEffect for better ssr support #2631

Merged
merged 3 commits into from
Oct 31, 2022

Conversation

oddvernes
Copy link
Collaborator

Resolves #2630

We used uselayoutEffect to bind anchor element to floating-ui reference, as shown in the floating-ui documentation, but I don't see why we can't use useEffect here, so I changed to that.
For pagination i am pretty sure we need the useLayouteffect to prevent flickering, so I made the useIsomorphicLayoutEffect in utils where server side rendering will fall back to useEffect

Copy link
Contributor

@denektenina denektenina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oddvernes oddvernes merged commit 764fb11 into develop Oct 31, 2022
@oddvernes oddvernes deleted the enh/OOVE-2630-ssr-remove-uselayouteffect branch October 31, 2022 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Menu component and useLayoutEffect is not optimal with SSR
2 participants