use-state-with-callback
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "use-state-with-callback", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -96,2 +96,8 @@ # useStateWithCallback React Hook | ||
## Pitfalls | ||
* When a state update is called with the current value and optimized away, the callback is never called. | ||
* `useStateWithCallbackLazy` calls the callback with the scope that existed before update, while this.setState callback can access the updated this.state and `get something()` computed values. This can't be fixed, but it's a problem for people who expect a drop-in replacement. | ||
* When `useStateWithCallbackLazy` state is updated several times with batching (e.g. in an event handler), only the last update calls the callback. | ||
## Contribute | ||
@@ -98,0 +104,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11435
114