This is my Code, But when we click other component this state remain same after refresh its OK
[getOrderList.fulfilled]:(state, action) => {
state.getUsersOrderList = [...state.getUsersOrderList, action.payload];
},
I Want to clear my previous state on payload
You could do this by only using the action.payload
in your array
[getOrderList.fulfilled]:(state, action) => {
state.getUsersOrderList = [action.payload];
},