-
Notifications
You must be signed in to change notification settings - Fork 50
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
Using masonic in nextjs #173
Comments
In my case
|
It doesn't make sense to render this component on the server. Simply put, it needs a browser window. |
Yes, sure, the component throws an error anyway despite using "use client" directive. Cause all client component code are still run in ssr. As per the reddit post |
Use a dynamic import |
I understand, but dynamic import only work for component, not for hooks. So for hooks like |
Ponyfill it? Dynamically import the component using the resize observer hook? Use a framework that isn't Next.js? Many options available |
Understood it. Also appreciate your answer. Just here to state the problem, it will cause error in nextjs server. Guess one day nextjs will fix it. |
You can wrap it in a |
According to this reddit page, seems quite a lots of hook will cause issuse using nextjs, and there is no work around. https://www.reddit.com/r/nextjs/comments/1bhfikg/window_is_not_defined_error_in_nextjs_14_app/
The text was updated successfully, but these errors were encountered: