react-three-fiber

Installation
SKILL.md

React Three Fiber

Declarative Three.js in React. The GPU is rarely the bottleneck — React reconciliation, draw calls, and per-frame allocations usually are.

Canvas setup

<Canvas
  dpr={[1, 2]}                 // clamp pixel ratio; Retina at 3x is brutal
  gl={{ powerPreference: 'high-performance', antialias: true }}
  frameloop="demand"           // render only when something changes (static scenes)
  camera={{ position: [0, 0, 5], fov: 50 }}
>
  • powerPreference: 'high-performance' asks the OS for the discrete GPU, not the iGPU. Big win on laptops.
  • Use frameloop="demand" for scenes that come to rest (configurators, viewers). Use the default loop only when something always moves.

The #1 rule: animate by mutation in useFrame, never setState

Installs
2
First Seen
Jun 29, 2026
react-three-fiber — shreyam1008/shre-skills