Skip to content

Commit

Permalink
bail out early if memoizedState didn't change
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jan 29, 2021
1 parent 77ed727 commit 5c24bb5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react-devtools-shared/src/backend/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,9 @@ export function attach(
const nextMemoizedState = next.memoizedState;

if (isEffect(prevMemoizedState) && isEffect(nextMemoizedState)) {
return !areHookInputsEqual(
nextMemoizedState.deps,
prevMemoizedState.deps,
return (
prevMemoizedState !== nextMemoizedState &&
!areHookInputsEqual(nextMemoizedState.deps, prevMemoizedState.deps)
);
}
return nextMemoizedState !== prevMemoizedState;
Expand Down

0 comments on commit 5c24bb5

Please sign in to comment.