Three.js Resizing Canvas
I applied Shawn Whinnery's answer to my needs with React JS: Start listener onMount: componentDidMount() { window.addEventListener('resize', this.handleResize, false) } Remove listener onUnmount (because we like garbage collection): componentWillUnmount() { window.removeEventListener('resize', this.handleResize, false) } Install handler function: handleResize = () => { this.camera.aspect = window.innerWidth / window.innerHeight this.camera.updateProjectionMatrix() this.renderer.setSize(window.innerWidth, window.innerHeight) } Fat arrow syntax is used to avoid binding this.
https://stackoverflow.com/questions/20290402/three-js-resizing-canvas