# React Authors - Hooks API Reference – React (Highlights) ![rw-book-cover|256](https://readwise-assets.s3.amazonaws.com/static/images/article1.be68295a7e40.png) ## 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.