Use 2d Physics Simulation for your react-dom elements.

Box2d Physics Engine integrated with react-dom

see it in action

https://codesandbox.io/s/xpv3ypv06q

Install

npm i react-dom-box2d

documentation

Documentation

Demos

shapes demo

https://1466m84mxl.codesandbox.io/

source for the demo

Force Demo

https://q8l48rwk49.codesandbox.io/

Collision detection demo

https://wsknn.codesandbox.io/

Rationale

Writing games is more fun Writing games should be simpler Physics simulations are cool

FAQs

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)