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

fix: hydration issues #4090

Merged
merged 4 commits into from
Jan 21, 2025
Merged

fix: hydration issues #4090

merged 4 commits into from
Jan 21, 2025

Conversation

sshanzel
Copy link
Member

@sshanzel sshanzel commented Jan 21, 2025

Changes

  • We have ongoing hydration issues as seen below.
  • We've done this in the past even though we know this is not the best way for us to work with the hydration issues, if you have some suggestions, I'd be happy to try.
  • The downside here is the SEO. Thankfully we don't require SEO for these kinds of pages.

Screenshot 2025-01-21 at 5 44 39 PM

Events

Did you introduce any new tracking events?

Experiment

Did you introduce any new experiments?

Manual Testing

Caution

Please make sure existing components are not breaking/affected by this PR

Preview domain

https://mi-765.preview.app.daily.dev

Copy link

vercel bot commented Jan 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview Jan 21, 2025 10:35am
1 Skipped Deployment
Name Status Preview Updated (UTC)
storybook ⬜️ Ignored (Inspect) Jan 21, 2025 10:35am

Comment on lines 133 to 139
useEffect(() => {
setIsHydrated(true);
}, []);

if (!isHydrated) {
return null;
}
Copy link
Contributor

@capJavert capJavert Jan 21, 2025

Choose a reason for hiding this comment

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

Since it is coming from useViewSize inside useFeedLayout, you can try using useViewSizeClient, it is the same hook only difference is that on the server it will always return false, it will do the same on the first render so there should be no hydration issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool. Let me look into that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it worked as intended.

Copy link
Contributor

@capJavert capJavert Jan 21, 2025

Choose a reason for hiding this comment

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

Since useFeedLayout is used in different pages, maybe just check it does not introduce some layout shifts on those pages, but it should be ok if this worked.

@@ -139,10 +138,7 @@ export default function BookmarkFeedLayout({
</Typography>
</FeedPageHeader>
<CustomFeedHeader
className={classNames(
'mb-6',
Copy link
Member Author

Choose a reason for hiding this comment

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

The component CustomFeedHeader already has the mb-6. No need for us to add it again.

@sshanzel
Copy link
Member Author

Tested and looks good to me! 🚀

@sshanzel sshanzel merged commit 6e1f673 into main Jan 21, 2025
10 checks passed
@sshanzel sshanzel deleted the MI-765 branch January 21, 2025 11:23
sshanzel added a commit that referenced this pull request Jan 22, 2025
sshanzel added a commit that referenced this pull request Jan 22, 2025
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.

2 participants