A fun Crash Course for React - Redux - Sagas
Here's a link to the presentation
To install both UI and API (server) dependencies run:
yarn install
To install/update ui deps
To run both UI and API run:
yarn start
The rest is up to you!
- Use the already loaded
heroes.json
file to display a list of our heroes (already imported, passed asprop
in theHeroList
Component. Feel free to create sub-components if you feel like it - such asHero
orHeroDetails
. Also feel free to style as you want your components usingemotionjs
styled-components). Only display heroname
andavatar
on that list. - When you click a hero on your list, its full description shows up (name, avatar, description). It can show either next to the list, above or underneath it. For this, you'll need to pass the
onClick
handler as a prop for now. - Instead of importing the
json
file and passing theheroes
list as a prop, create a global store with aheroes
reducer and load the data in there. Connect the component to the store and make sure your app still works! - Instead of passing the
onClick
as a prop, when you click on a hero it will need to dispatch an action to your store, which then update theselectedHero
property with the selected hero's data. And you'll use this property to update your component's state accordingly. - Up until now the hero list is being imported from local environment. At this step you'll need to use
redux-thunk
to load your heroes list from your server (endpoint for this is:http://localhost:3000/heroes
) to your store. - Once you've acoomplished that with
redux-thunk
you can go on and try the exact same thing but using theredux-saga
middleware. - Feel free to play with any variations you want. To infinity and beyond!