r3f-learning-01

LESSON 01

Basics

A cube, a sphere, a lit floor, and OrbitControls. Animation runs in useFrame via refs — never setState in the loop. The scene is wrapped in React.memo because its parent is a static Server Component.

Drag to orbit · scroll to zoom · right-click to pan. Geometries use literal args arrays so R3F memoises them by array identity; materials are JSX-declared and disposed automatically on unmount.