Promptles
React & Frontend

Hook

beginner

Definition

A small helper that lets a building block remember things, react to changes, or do work in the background. There are different hooks for different jobs: one for remembering values, one for running setup code, one for tapping into shared settings.

In the wild

A counter button uses a hook to remember how many times it's been clicked. Without the hook, every click would reset the count back to zero: the button would have no memory of what just happened.

More from React & Frontend