mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 17:58:55 +00:00
The hook was called below the `if (!currentSceneObject) return null` guard, so renders where `currentSceneObject` was null skipped the hook entirely. When it flipped to non-null on a later render, React saw a new hook appear and threw "rendered more hooks than during the previous render". Move `useViewportSize()` (and the `getScale` helper that consumes it) above the early return so the hook order is stable across renders.