I have a state in Redux that currently renders like this:
Before click:
{0: {
    open: false,
    negation: false,
    close: false
    },
1: {
    open: false,
    negation: false,
    close: false,
    bool: "and"
    }
}
After click:
{0: {
    open: false,
    negation: false,
    close: false
    },
1: {}
}
I'd like to completely remove the key 1 (in general it's [action.id]).
Currently the cases in the reducer are:
case 'HANDLE_INCREASE_CHANGE':
  return {
    ...state,
    index: state.index + 1,
    [state.index + 1]: {
      open:false,
      negation: false,
      close: false,
      bool: 'and'
    }
  }
case 'HANDLE_DECREASE_CHANGE':
  return {
    ...state,
    index: state.index - 1,
    [state.index]: {}
  }
The wrong part is:
[state.index]: {}
Can you help me please? thanks a lot!
 
     
     
    