diff --git a/src/useStateWithHistory.ts b/src/useStateWithHistory.ts index caaed66ed3..4c1e299e76 100644 --- a/src/useStateWithHistory.ts +++ b/src/useStateWithHistory.ts @@ -57,7 +57,7 @@ export function useStateWithHistory( const setState = useCallback( (newState: ResolvableHookState): void => { innerSetState((currentState) => { - newState = resolveHookState(newState); + newState = resolveHookState(newState, currentState); // is state has changed if (newState !== currentState) {