Skip to content

Glossary: React Beyond the Basics

rules of hooks

Call hooks only at the top level of a component or custom hook, never inside `if`, loops or handlers. Breaking this makes React report a change in the order of hooks.

Where the book teaches it

Related terms

custom hook