# React Authors - Hooks API Reference – React (Highlights)

## Metadata
**Cover**:: https://readwise-assets.s3.amazonaws.com/static/images/article1.be68295a7e40.png
**Source**:: #from/readwise
**Zettel**:: #zettel/fleeting
**Status**:: #x
**Authors**:: [[React Authors]]
**Full Title**:: Hooks API Reference – React
**Category**:: #articles #readwise/articles
**Category Icon**:: 📰
**URL**:: [reactjs.org](https://reactjs.org/docs/hooks-reference.html)
**Host**:: [[reactjs.org]]
**Highlighted**:: [[2022-05-06]]
**Created**:: [[2022-09-26]]
## Highlights
- If the new state is computed using the previous state, you can pass a function to setState
Useful to not depend on a stalled state captured by the closure.
- If you want to run an effect and clean it up only once (on mount and unmount), you can pass an empty array ([]) as a second argument.