I don’t understand why my incAction is working and my decAction is not .
**Your code so far**
const INCREMENT = 'INCREMENT'; // Define a constant for increment action types
const DECREMENT = 'DECREMENT'; // Define a constant for decrement action types
const defaultState = 0;
const counterReducer = (state = defaultState, action) => {
switch (action.type) {
case INCREMENT:
return state +1;
case DECREMENT:
return state +1;
default:
return state;
}
}; // Define the counter reducer which will increment or decrement the state based on the action it receives
const incAction = () => {
return {
type: INCREMENT
};
} // Define an action creator for incrementing
const decAction = () => {
return {
type: DECREMENT
};
} // Define an action creator for decrementing
const store = Redux.createStore(
counterReducer,
Redux.applyMiddleware(ReduxThunk.default)
); // Define the Redux store here, passing in your reducers
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Redux - Write a Counter with Redux
Link to the challenge: