# 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

- **Space:** threejs-public (https://github.com/Tech-Realm/space-threejs-public/tree/main/r3f-starter)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3, playwright-python, chromium
- **Routes:** esm-local, vite; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use threejs-public/r3f-starter` or MCP `get_pack threejs-public/r3f-starter`
- **Files:** CHANGELOG.md, code/App.js, code/index.html, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (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
1. Prototype: serve `code/` (React, R3F and drei from esm.sh, pinned versions).
2. Real project: `npm create vite@latest app -- --template react` then `npm i three @react-three/fiber @react-three/drei` and copy `App.js` logic.
3. Use `useFrame` for animation; keep state out of the render loop.
4. 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.



---

Canonical URL: https://logicpacks.io/packs/threejs-public/r3f-starter

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
