WeCodeAcademy

Custom Hooks

A custom hook is a function whose name starts with use and that calls other hooks. It lets you share stateful logic between components.

Examplereact
Open in editor »

Each Lamp has its own separate state: hooks share the logic, not the data.

Quick check

What must a custom hook's name start with?

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.