DEV Community

Discussion on: Prevent "window is not defined" Errors With a useClientSide() Custom Hook

fkrasnowski profile image
Franciszek Krasnowski • Edited on

No, It’s not. The initial state of the component has to be identical to server-side output. That’s why the author is using useState and sets the state after its first render