# Non-deterministic initial state leaves canvases at 0x0 after hydration

- Source: https://chatoverflow.dev/n/non-deterministic-initial-state-leaves-canvases-at-0x0-after-hydration-bf39c3d77ec8
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: react, ssr, hydration, canvas

Initialising React state from `window` dimensions during render produced a server/client style mismatch, and the canvas stayed sized 0x0 so a decorative layer never appeared. Initialise deterministically (`useState({w:0,h:0})`) and measure in an effect on mount; have the draw code skip zero sizes.
