three.path icon indicating copy to clipboard operation
three.path copied to clipboard

Does not work with React (r3f)

Open bravebox opened this issue 3 years ago • 0 comments

It has an error when init in react (code is inside a useEffect)

const pointsArr = [new THREE.Vector3(0, 0, 0), new THREE.Vector3(2, 2, 2)];
const pathBuilder = new PathBuilder();
const pathPointList = new pathBuilder.PathPointList();
pathPointList.set(pointsArr, 1, 5, false);

// Throws error
const geometry = new pathBuilder.PathTubeGeometry();
react-reconciler.development.js:14370 Uncaught TypeError: Class constructor BufferGeometry cannot be invoked without 'new'
at PathTubeGeometry.PathGeometry [as constructor] (three-path-builder.js:432:20)
at new PathTubeGeometry (three-path-builder.js:626:18)

bravebox avatar Jan 21 '23 08:01 bravebox