-
Notifications
You must be signed in to change notification settings - Fork 242
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
fix: hydration issues #4090
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
useEffect(() => { | ||
setIsHydrated(true); | ||
}, []); | ||
|
||
if (!isHydrated) { | ||
return null; | ||
} |
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.
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.
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.
Cool. Let me look into that.
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.
Yeah, it worked as intended.
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.
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', |
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.
The component CustomFeedHeader
already has the mb-6
. No need for us to add it again.
Tested and looks good to me! 🚀 |
Changes
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