---
name: r3f-fundamentals
description: React Three Fiber core setup, Canvas configuration, scene hierarchy, camera systems, lighting, render loop, and React integration patterns. Use when setting up a new R3F project, configuring the Canvas component, managing scene structure, or understanding the declarative Three.js-in-React paradigm. The foundational skill that all other R3F skills depend on.
---
# React Three Fiber Fundamentals
Declarative Three.js via React components. R3F maps Three.js objects to JSX elements with automatic disposal, reactive updates, and React lifecycle integration.
## Quick Start
```tsx
import { Canvas } from '@react-three/fiber';
function App() {
return (
);
}
```
## Core Principle: Declarative Scene Graph
R3F converts Three.js imperative API to React's declarative model:
| Three.js (Imperative) | R3F (Declarative) |
|----------------------|-------------------|
| `new THREE.Mesh()` | `` |
| `mesh.position.set(1, 2, 3)` | `` |
| `scene.add(mesh)` | JSX nesting handles hierarchy |
| `mesh.geometry.dispose()` | Automatic on unmount |
## Canvas Configuration
```tsx
import { Canvas } from '@react-three/fiber';