Skip to content

Glossary: React Basics

Rules of hooks

Call hooks only at the top level of a component, before any `return`, never inside an `if`, loop or nested function. That way every render calls the same hooks in the same order.

Where the book teaches it

Related terms

HookEarly return