...
/Actions Dispatched. Does this Thing Work?
Actions Dispatched. Does this Thing Work?
In the last lesson, we dispatched our onClick action to the reducer. Let's check the reducer's console log to see if it receives the action.
We'll cover the following...
Firstly, here’s a short quiz question.
Q
Upon clicking a button and consequently dispatching an action, what happens next within Redux? i.e which
Redux actors come into play?
A)
Store
B)
Reducer
C)
State Object
So the answer is the reducer. You can find the explanation up above, but to prove this further, I’ll log whatever action comes into the reducer.
reducers/index.js:
Press + to interact
export default (state, action) => {console.log(action);return state;};
The reducer then returns the new state of the app. In ...