Now that we have a lot of functionality finished for this example, we'd like to create multiple components (or multiple canvases) that you can draw on.
You'll notice that if you do that right now, drawing on one will draw on the other because state is global to the entire application.
Jotai exposes a Provider
component that allows you to wrap any part of your application that you want to isolate state to.
It's so simple and elegant that Daishi gets BoundingClientRect from the event's target! I was always dragging a React ref around like a fool.
Thank you, Kato san!
wow. what an ending haha! I love how the entire series is built from a simple concept - thank you, explains the concepts and subsequent benefits of Jotai, quickly. However, I wish it were a little slower in parts, and the overview at the end of each video was a little more detailed.
Concise and good, go over many issues and use cases. What I would love: