Skip to content

Commit

Permalink
Remember eagerReducer even if there is nothing in the queue
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Mar 16, 2019
1 parent daac56e commit 6670512
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,9 @@ function updateReducer<S, I, A>(
hook.baseUpdate = newBaseUpdate;
hook.baseState = newBaseState;

queue.eagerReducer = reducer;
queue.eagerState = newState;
}
queue.eagerReducer = reducer;

const dispatch: Dispatch<A> = (queue.dispatch: any);
return [hook.memoizedState, dispatch];
Expand Down

0 comments on commit 6670512

Please sign in to comment.