Enter Konva and react-konva. All the benefits of declarative code, but rendered on the canvas.
I'm gonna let Anton Lavrenov, the author of Konva, explain:
You can draw things onto the stage, add event listeners to them, move them, scale them, and rotate them independently from other shapes to support high performance animations, even if your application uses thousands of shapes. Served hot with a side of awesomeness.
It's exactly what we need to push our animated React apps to thousands of elements without spending too much time thinking about the how of rendering. Best leave the hairy details to somebody else.
Let's try out two examples:
- Pushing our particle generator to 20,000 elements
- An n-body collision simulator built with MobX