Building three.js scenes from React with React Three Fiber and drei: renderer setup, the scene graph as JSX, frame-loop, state and loading hooks, pointer…
Three.js React Three Fiber
Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.
Quick Start
Targets @react-three/fiber 9.8 with React 19 and @react-three/drei 10.7. The Canvas creates and owns a WebGLRenderer, a scene and a camera; three.js objects become JSX elements. The Canvas fills its parent element, so give the parent a height. The component fragments below render inside a Canvas like this one; lit materials assume its lights.
import { useRef } from "react";
import { Canvas, useFrame } from "@react-three/fiber";
import { OrbitControls } from "@react-three/drei";
don't have the plugin yet? install it then click "run inline in claude" again.
+opening quick-start code snippet is concrete and immediately copy-paste-able
+acknowledges webgl and webgpu renderer paths (though webgpu section incomplete)
weaknesses
~missing explicit intent, decision-points, output contracts, and outcome signals - reads as incomplete reference rather than skill
~no trigger phrases present; description lists topics but no concrete scenarios (e.g. 'load a gltf model and animate it on pointer hover')
~edge cases absent: no mention of cleanup, context loss recovery, performance cliffs at poly counts, or common gotchas like canvas parent sizing or renderer disposal