Has anyone tried using the OrbitControls function with ReactJS? Here is the sample code I wrote:
import React, { Component } from \'react\';
import \'tachy
I just did it like this when using parcel bundler:
app.js:
import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
// the rest of the example from threejs web page
// https://github.com/mrdoob/three.js/blob/master/examples/misc_controls_orbit.html
index.html:
Parcel threejs example
package.json:
{
"name": "test-threejs-with-parcel",
"version": "0.1.0",
"description": "Threejs with parcel test",
"main": "app.js",
"scripts": {
"start": "parcel index.html",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"parcel-bundler": "^1.10.0"
},
"dependencies": {
"three": "^0.109.0"
}
}