Next.js Discord

Discord Forum

Are hooks not able to run on server since NextJS 13?

Answered
White-tailed Tropicbird posted this in #help-forum
Open in Discord
White-tailed TropicbirdOP
As far as I understand on NextJS 13 in app directory, hooks are no longer able to run on server at all, right?
So now we don't have to make these stupid if (typeof window !== 'undefined') checks in our hooks, right?
Answered by joulev
Client components are prerendered on the server so you still need to write hydration-safe code
View full answer

1 Reply