Tell us what’s happening:
Describe your issue in detail here.
*Your code so far
Hi guys, it keeps saying I should Dispatching incAction on the Redux store should increment and decrement to the state by 1`javascript. I need help
const INCREMENT = "INCREMENT"; // Define a constant for increment action types
const DECREMENT = "DECREMENT"; // Define a constant for decrement action types
const counterReducer = (state = 0, action) => {
switch(action.types){
case INCREMENT:
return state++;
case DECREMENT:
return state--;
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); // Define the Redux store here, passing in your reducers
Your browser information:
User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1
Challenge Information:
Redux - Write a Counter with Redux