-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
withNotices: Memoize the noticeOperations object (#29582)
The refactor of withNotices in #28676 introduced a bug where the functions within `noticeOperations` were changing on every render. That meant that if they were present in the dependency array of a useEffect, then the effect would trigger causing an infinite loop. This was partially fixed with #29491, but there are other instances where the noticeOperations object itself is being listed as a dependency, and so the problem persists. As suggested by @stokesman #29491 (comment) this change memoizes the whole object.
- Loading branch information
Showing
1 changed file
with
44 additions
and
46 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