-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 calling setValue() in useLayoutEffect() doesn't work
this also introduces a breaking change because now if you call setValue() during render and you have two instances of the hook with the same hook React will call console.error() with the following message: "Warning: Cannot update a component (`Component`) while rendering a different component (`Component`). To locate the bad setState() call inside `Component`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render.
- Loading branch information
Showing
2 changed files
with
74 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters