14.20 Practice
Time for you to practice redux
and redux-react
together a little bit. Is only one task in the assignment. Turn the application you find attached to this assignment problem here into one using redux. In this application we simply get a button which generates random users, actually just the ages random. You can also click on then to remove them. And of course you can inspect the code for them. It's a react application using the features you learned about thus far prior to redux.
So it's a simply has the container components AddPerson
and the Person
component. Clicklistners pass through props for both of these. Handle methods are defining in the container, and then we manage the state with the persons array.
We used immutable update method concat
and filter
to update that array. With the Person that generates here. Random age. Random id. Sidenote the id is not really unique but good enough here.
And then is it.
This our application.
Now I want you to, first of all, install redux
and react-redux
. Then to create the reducer. Create that store. Set up that store by adding a provider. And then of course also create map dispatch the props and map state props.
Manage our persons
array and the actions related to it in our redux store.
Good luck with it. Feel free to revisit some lectures of this module as a obviously spread new and typical to do, but you can do it will solve it together in the solution video.