Skip to content

Commit 08d2fc7

Browse files
committed
docs(README.mD): mention not drop in replacement
1 parent 273d4f2 commit 08d2fc7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ export default App;
9696
## Pitfalls
9797

9898
* When a state update is called with the current value and optimized away, the callback is never called.
99+
* `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.
100+
101+
99102
## Contribute
100103

101104
- `git clone [email protected]:the-road-to-learn-react/use-state-with-callback.git`

0 commit comments

Comments
 (0)