Why do we need to return state from reducer in React : I am new to Redux and was trying to get how to work with Redux properly but I encountered a confusion on why we need to return state in reducer. Here is the code:

    const initialState = {
      counter: 0
    };
    
    const reducer = (state = initialState, action) => {
      if (action.type === "INCREMENT") {
        return {
          counter: state.counter + 1
        };
      }
      return state; why do we need to use this code?
    };
    
    export default reducer;