Skip to content

Commit

Permalink
Avoid declaration of potential unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Apr 26, 2022
1 parent 547a7c7 commit 89affab
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/components/src/input-control/reducer/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ function inputControlStateReducer(
composedStateReducers: StateReducer
): StateReducer {
return ( state, action ) => {
const nextState = { ...state };

// Updates state and returns early when there's no action type. These
// are controlled updates and need no exposure to additional reducers.
if ( ! ( 'type' in action ) ) {
Expand All @@ -62,6 +60,7 @@ function inputControlStateReducer(
value: `${ action.value ?? '' }`,
};
}
const nextState = { ...state };

switch ( action.type ) {
/**
Expand Down

0 comments on commit 89affab

Please sign in to comment.