To make it work, you should do the following: save the link to the container div element:
<div style={{width:"inherit", height:"inherit", position:"absolute"}} ref={thisNode => this.container=thisNode} > </div>
This will keep your canvas inside. Then, in the DidMount component, add your 3D canvas to the container.
this.container.appendChild(renderer.domElement);
You will also forget to call this.renderer.render(scene,camera); And also do not restore the elements of the scene and rendering on each player. Think about it, if you update the scene with your current setting, you will recreate a new scene, a new renderer on each animation frame, how can this even be possible? Start your configurations in the DidMount component, and then correct them in the didUpdate component, you can also avoid binding using the arrow functions animate = () => {} .
Anatoly Strashkevich
source share