Redux Toolkit Not Updating State as Expected
7 months ago Asked
0 Answers
29 Views
I'm using Redux Toolkit in my React.js application, and I have a reducer like this:
import { createSlice } from '@reduxjs/toolkit';
const counterSlice = createSlice({
name: 'counter',
initialState: { value: 0 },
reducers: {
increment: (state) => {
state.value += 1;
},
},
});
export const { increment } = counterSlice.actions;
export default counterSlice.reducer;