JSFiddle - React, Tailwind, and code Playground

CSS

body {
	  margin: 0;
}

JavaScript

import * as THREE from 'https://cdn.skypack.dev/[email protected]/build/three.module.js';

let camera, scene, renderer;

let group, helper;

init();
animate();

function init() {

    camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.01, 10 );
    camera.position.z = 6;

    scene = new THREE.Scene();
		
		group = new THREE.Group();

    const geometry = new THREE.BoxGeometry();

    const mesh1 = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 'red' } ) );
		mesh1.position.x = 1;
    group.add( mesh1 );
		
		const mesh2 = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 'blue' } ) );
		mesh2.position.x = - 1;
    group.add( mesh2 );
		
		scene.add( group );
		
		helper = new THREE.BoxHelper( group );
		scene.add( helper );

    renderer = new THREE.WebGLRenderer( { antialias: true } );
    renderer.setSize( window.innerWidth, window.innerHeight );
    document.body.appendChild( renderer.domElement );

}

function animate() {

    requestAnimationFrame( animate );

    group.rotation.x += 0.01;
    group.rotation.y += 0.02;
		
		helper.update();

    renderer.render( scene, camera );

}