Skip to content

Commit

Permalink
fix(mobx-react-lite): reset state properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed Oct 19, 2023
1 parent 2895cdf commit 77fef63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/mobx-react-lite/src/useObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function useReactionDisposer(adm: ObserverAdministration) {
if (animationRequestIDRef.current !== null) {
// Component mounted, we don't need to dispose reaction anymore
cancelAnimationFrame(animationRequestIDRef.current)
animationRequestIDRef.current = null
}

// In some rare cases reaction will be disposed before component mounted,
Expand Down

0 comments on commit 77fef63

Please sign in to comment.