Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Replaces The useLayoutEffect With useIsomorphicEffect in useAnimations To Support Server Rendering #222

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

kenneth-duverge
Copy link
Collaborator

@kenneth-duverge kenneth-duverge commented Jan 27, 2023

What this PR does

The Video Library page in the Next app logged an error to the console about a useLayoutEffect being run on the server. One of the components rendered is the Modal component, which uses the useMountAnimations hook, which uses useLayoutEffect.

Screenshots & Recordings

Error No Error
Screenshot 2023-01-27 at 12 20 52 PM Screenshot 2023-01-27 at 12 19 42 PM

How it does that

Replaced all useLayoutEffect hooks with useIsomorphicEffect.

Testing

@kenneth-duverge kenneth-duverge marked this pull request as ready for review January 27, 2023 18:09
@kenneth-duverge kenneth-duverge requested review from a team as code owners January 27, 2023 18:09
@heylookltsme
Copy link
Contributor

Bless you! 🙏🏻

Copy link
Collaborator

@juliewongbandue juliewongbandue left a comment

Choose a reason for hiding this comment

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

eyy!!

@kenneth-duverge kenneth-duverge merged commit cfd9296 into main Jan 27, 2023
@kenneth-duverge kenneth-duverge deleted the update-use-animations-effects branch January 27, 2023 20:02
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants