Skip to content

Commit

Permalink
Simplify nested hook warning logic in dev
Browse files Browse the repository at this point in the history
We have so many dispatchers. And with my changes in facebook#26232 it's a bit harder to see if the previous logic was correct. Here I'm moving the flag to a separate value which makes it easier to see that it will work properly with the live dispatcher switch and that the prod behavior is not affected.

I cheated and mutated ContextOnlyDispatcher in place in dev (previously ContextOnlyDispatcher.readContext would not warn when in a state update but that dispatcher wouldn't be active at the times it's relevant).

Also adds the hook ordering warnings to useMemoCache.
  • Loading branch information
sophiebits committed Feb 25, 2023
1 parent 5641660 commit 7265ff7
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 623 deletions.
Loading

0 comments on commit 7265ff7

Please sign in to comment.