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

Warning: useLayoutEffect does nothing on the server when using Drawer from vaul in Nextjs 13 #351

Open
rahXephonz opened this issue May 14, 2024 · 0 comments · May be fixed by #368
Open

Comments

@rahXephonz
Copy link

rahXephonz commented May 14, 2024

Screenshot 2024-05-14 at 20 16 50
Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.
    at Root (file://clients/web/node_modules/.pnpm/vaul@0.9.1_@types+react-dom@18.2.0_@types+react@18.2.0_react-dom@18.2.0_react@18.2.0/node_modules/vaul/dist/index.mjs:749:23)
    at Drawer

i have use shadcn drawer and i believe its extending vaul in the components.
so i have this error in every page or component that using Drawer from Vaul

Is there any solutions to supress this warning?

@rahXephonz rahXephonz changed the title Warning: useLayoutEffect does nothing on the server in Drawer from vaul in Nextjs 13 Warning: useLayoutEffect does nothing on the server when using Drawer from vaul in Nextjs 13 May 15, 2024
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 a pull request may close this issue.

1 participant