You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The component Calendar has an hydratation issue with disableAnimation prop (from NextUIProvider) when using SSR and useReduceMotion.
Let's say we want to disable animation when user has reduce motion enabled.
On server, disableAnimation is undefined because we don't know the config of reduce motion from server (that's normal).
On client, if disableAnimation is true, we have hydratation issue.
Steps to Reproduce the Bug or Issue
Enable reduceMotion on your machine
Add this in your app.tsx
constisReducedMotion=useReducedMotion()// from framer-motion// ....// HYDRATATION ISSUE HERE<NextUIProviderdisableAnimation={isReducedMotion}><CalendarcalendarWidth={350}/></NextUIProvider>
Expected behavior
No Hydration issue just because of reduceMotion is changing to true to false or whatever
Screenshots or Videos
Operating System Version
MacOS
Browser
Chrome
The text was updated successfully, but these errors were encountered:
To avoid the hydration error, it's necessary to ensure that the initial render is consistent between the server and the client.
useEffect hook ensures that the state is only updated on the client side, avoiding discrepancies between the server-rendering and client-rendering HTML.
NextUI Version
2.4.2
Describe the bug
The component
Calendar
has an hydratation issue withdisableAnimation
prop (fromNextUIProvider
) when using SSR and useReduceMotion.Let's say we want to disable animation when user has reduce motion enabled.
On server,
disableAnimation
isundefined
because we don't know the config of reduce motion from server (that's normal).On client, if
disableAnimation
istrue
, we have hydratation issue.Steps to Reproduce the Bug or Issue
reduceMotion
on your machineapp.tsx
Expected behavior
No Hydration issue just because of reduceMotion is changing to
true
tofalse
or whateverScreenshots or Videos
Operating System Version
MacOS
Browser
Chrome
The text was updated successfully, but these errors were encountered: