Command Palette

Search for a command to run...

Hectal
Phase 11: React Three Fiber
3D Web · Exercise 2 of 5 PreviousNext
Beginner

Spin without state

The spinner works, but React renders it on every frame. Rewrite it so it spins through a ref in useFrame, with no useState, and renders only once or twice.

What Check tests

  1. The mesh named spinner turns
  2. The component rendered fewer than 5 times
  3. The code does not use useState

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.