Use 2d Physics Simulation for your react-dom elements.
Box2d Physics Engine integrated with react-dom
https://codesandbox.io/s/xpv3ypv06q
npm i react-dom-box2d
https://1466m84mxl.codesandbox.io/
https://q8l48rwk49.codesandbox.io/
- Writing games is more fun
- Writing games should be simpler
- Physics simulations are cool
1.Why dom ?
Dom is definitely slower compared to Canvas/WebGL. But there is a good reason for it. Dom does a lot of things , that would be not easy to implement ourselves (event handling, accessibility, layout,style,...etc)
And also this would lower the barrier of entry for majority of Web Developers (use css for styling)