Using Matter.js to render to the DOM or React
However, I cannot understand how to pass an HTML element inside the Bodies rectangle as in the example above. This isn’t quite what the example does. When running headlessly, Matter.js handles the physics without having any idea how it’s rendered. Per animation frame, you can use the current positions of the MJS bodies and reposition … Read more