Packs / threejs-public
r3f-starter
Start a react-three-fiber scene (React 18 + @react-three/fiber + drei) without a build step, ready to move into a Vite app
Install
logicpacks pack use threejs-public/r3f-starterget_pack threejs-public/r3f-starterThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
esm-localvite - Checks: 1 in
outcome/checks.yaml - Code:
App.jsindex.html - Tools: python3, playwright-python, chromium
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
A minimal R3F app (Canvas, lights, a spinning mesh, OrbitControls from drei) loaded from esm.sh, plus the Vite command for a real project.
Steps
- Prototype: serve
code/(React, R3F and drei from esm.sh, pinned versions). - Real project:
npm create vite@latest app -- --template reactthennpm i three @react-three/fiber @react-three/dreiand copyApp.jslogic. - Use
useFramefor animation; keep state out of the render loop. - Check:
python3 ../tools/webgl_check.py code --js "window.__r3f === true".
Edge cases
- esm.sh must dedupe react: the import map pins one React for all packages (
?deps=). - R3F v8 pairs with React 18; R3F v9 with React 19.
Don'ts
- Don't setState inside useFrame.
- Don't ship the esm.sh prototype to production; bundle with Vite.