arrow_backBACK TO DRILLS
Black Beltrules-of-hookslockPREMIUM

Multiple useSWR Hooks With Suspense Triggers a Hooks Order Warning

SWR is configured with suspense: true, and the component calls useSWR twice.

REACT_MODULE // 0x42
function Dashboard() {
const { data: user } = useSWR('/api/user', fetcher, { suspense: true });
const { data: stats } = useSWR('/api/stats', fetcher, { suspense: true });
return <div>{user.name}: {stats.total}</div>;
}

This intermittently logs "Rendered fewer hooks than expected." What causes it?

lock

This Drill is Locked

This is a premium drill. Continue on to the next free drill in the sequence.

CONTINUE DRILLarrow_forward
BugDojo
BlogFAQ

© 2026. Carved in code.