react: Save you Rerenders and Upload Capability with Jotai Write-only Atoms

We’ve got a naive SVG app that may draw dots onto a canvas because the mouse scrolls over. You’ll understand as you drag the mouse across the canvas that the dedicate rely within the most sensible left nook will increase. It’s because the SVG element rerenders on each and every dot that’s drawn.

The rerenders are because of the truth that we’re the usage of the dotsAtom at once within the element. That is the place write-only atoms turn out to be useful. They are able to obtain a write serve as that can care for the updates in your atom state which can repair the rerender factor.

We will be able to additionally duvet easy methods to compose write-only atoms so as to add capability.