Action Dispatch

We will be associating the setActiveUserID action we made in the last lesson with the onClick handler of our User div. This will dispatch the action on a click. We will implement this functionality in User.js.

We'll cover the following...

In the last lesson we made the action creator called setActiveUserID, which returns the user object based on the id it is given.

Now we must dispatch the action.

Let’s keep moving.

Take a look at the User.js component.

The first line of the return statement is a div with the class name, User:

 ...