useLatest*

React state hook that returns the latest state.

hooks
Description of the SVG image Loading...

As described here (legacy): https://legacy.reactjs.org/docs/hooks-faq.html#why-am-i-seeing-stale-props-or-state-inside-my-function

"This is mostly useful to get access to the latest value of some props or state inside an asynchronous callback, instead of that value at the time the callback was created from."

Installation

Run the following command:

npx ever-ui-clx@0.2.1 add demo-use-latest
# └──> Hook coming soon.

Usage