Are hooks not able to run on server since NextJS 13?
Answered
White-tailed Tropicbird posted this in #help-forum
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
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
1 Reply
@White-tailed Tropicbird 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?
Client components are prerendered on the server so you still need to write hydration-safe code
Answer