Registers a function that runs on every render frame (paint phase).
This hook MUST be called at the top level of a component function — never inside loops, conditions, nested functions, or callbacks.
The call order of all hooks is strictly fixed across every refresh; reordering calls will corrupt internal state.
Multiple usePaint calls stack and run in declaration order.
Call event.preventDefault() to skip remaining paint calls (including default rect fill).
Registers a function that runs on every render frame (paint phase).
This hook MUST be called at the top level of a component function — never inside loops, conditions, nested functions, or callbacks. The call order of all hooks is strictly fixed across every refresh; reordering calls will corrupt internal state.
Multiple
usePaintcalls stack and run in declaration order. Callevent.preventDefault()to skip remaining paint calls (including default rect fill).