Skip to content

Glossary: React Basics

Cleanup function

Also written: cleanup, clean-up function

The function an effect returns. React runs it before the effect runs again and when the component unmounts, for example to stop a timer or abort a request.

Where the book teaches it

Related terms

useEffectMount / unmountDependency array