react/packages
Sebastian Silbermann bb1b7951d1
fix: don't run effects if a render phase update results in unchanged deps (#20676)
The memoized state of effect hooks is only invalidated when deps change. Deps are compared between the previous effect and the current effect. This can be problematic if one commit consists of an update that has changed deps followed by an update that has equal deps. That commit will lead to memoizedState containing the changed deps even though we committed with unchanged deps.

The n+1 update will therefore run an effect because we compare the updated deps with the deps with which we never actually committed.

To prevent this we now invalidate memoizedState on every updateEffectImpl call so that memoizedStat.deps always points to the latest deps.
2021-01-29 10:51:11 -05:00
..
create-subscription Bump versions for 17 (#20062) 2020-10-20 21:41:18 +01:00
dom-event-testing-library Revise useFocus/useFocusWithin (#19310) 2020-07-10 17:23:00 +01:00
eslint-plugin-react-hooks Fix ESLint crash on empty react effect hook (#20385) 2021-01-11 15:18:45 -05:00
jest-mock-scheduler Bump versions for 17 (#20062) 2020-10-20 21:41:18 +01:00
jest-react Bump versions for 17 (#20062) 2020-10-20 21:41:18 +01:00
react Improve React error message when mutable sources are mutated during render (#20665) 2021-01-29 10:22:55 -05:00
react-art Add queue microtask to host configs (#20668) 2021-01-27 15:01:21 -05:00
react-cache Bump versions for 17 (#20062) 2020-10-20 21:41:18 +01:00
react-client [Flight] Rename react-transport-... packages to react-server-... (#20403) 2020-12-08 08:08:57 -05:00
react-debug-tools Remove custom error message from hook access error (#20604) 2021-01-19 14:20:22 -08:00
react-devtools [devtools] Bump electron version from 9.1.0 to 11.1.0 for darwin-arm64 builds (#20496) 2021-01-04 10:38:11 -05:00
react-devtools-core Expose DEV-mode warnings in devtools UI (#20463) 2020-12-22 11:09:29 -05:00
react-devtools-extensions Expose DEV-mode warnings in devtools UI (#20463) 2020-12-22 11:09:29 -05:00
react-devtools-inline Expose DEV-mode warnings in devtools UI (#20463) 2020-12-22 11:09:29 -05:00
react-devtools-scheduling-profiler Add scheduling profiler deployment CI job (#19874) 2020-09-22 08:34:06 -04:00
react-devtools-shared fix: don't run effects if a render phase update results in unchanged deps (#20676) 2021-01-29 10:51:11 -05:00
react-devtools-shell Add rudimentary support for Cache to DevTools (#20458) 2021-01-04 09:32:03 -05:00
react-dom Queue discrete events in microtask (#20669) 2021-01-27 18:24:58 -05:00
react-fetch Add Flight packages to experimental allowlist (#20486) 2020-12-18 14:29:48 -08:00
react-fs Add Flight packages to experimental allowlist (#20486) 2020-12-18 14:29:48 -08:00
react-interactions Bump versions for 17 (#20062) 2020-10-20 21:41:18 +01:00
react-is Fixed invalid DevTools work tags (#20362) 2020-12-01 10:33:32 -05:00
react-native-renderer Add queue microtask to host configs (#20668) 2021-01-27 15:01:21 -05:00
react-noop-renderer Add queue microtask to host configs (#20668) 2021-01-27 15:01:21 -05:00
react-pg Add Flight packages to experimental allowlist (#20486) 2020-12-18 14:29:48 -08:00
react-reconciler fix: don't run effects if a render phase update results in unchanged deps (#20676) 2021-01-29 10:51:11 -05:00
react-refresh Improve tests that use discrete events (#20667) 2021-01-26 19:15:06 -05:00
react-server Error for deferred value and transition in Server Components (#20657) 2021-01-25 13:58:47 -08:00
react-server-dom-relay clone json obj in relay flight client host config parser (#20465) 2020-12-15 15:33:54 -08:00
react-server-dom-webpack Add Flight packages to experimental allowlist (#20486) 2020-12-18 14:29:48 -08:00
react-server-native-relay clone json obj in react native flight client host config parser (#20474) 2020-12-16 11:53:51 -08:00
react-suspense-test-utils Add built-in Suspense cache with support for invalidation (refreshing) (#20456) 2020-12-18 10:57:24 -08:00
react-test-renderer Queue discrete events in microtask (#20669) 2021-01-27 18:24:58 -05:00
scheduler Remove `catch` from Scheduler build (#20396) 2020-12-07 11:10:53 -08:00
shared Improve React error message when mutable sources are mutated during render (#20665) 2021-01-29 10:22:55 -05:00
use-subscription use-subscription@1.5.1 2020-11-12 00:36:00 +00:00