This is a small app, part of this Udemy course, that lets you see and like episodes from the show Rick & Morty.
It's made with Typescript and React, making use of Hooks and Context.
To run it:
git clone https://github.com/marcorichetta/rick-morty-typescript.git
cd rick-morty-typescript
yarn start
Open http://localhost:3000 to view it in the browser.
The main component which renders the header and uses a Switch
to route to the pages defined on /pages
.
Presentational component to define the list of episodes brought from the API.
The pages that display the list of episodes and the favorite ones.
It contains 2 functions:
fetchData
: Used onuseEffect
hook to gather the episodes from the API after the homepage is rendered.toggleFavorite
: An action to like/dislike an episode when you click the '+1' button.
It contains the different types of data used in this application. It's one of the main advantages of using Typescript.
It uses Context
and reducer
to manage how data flow based on actions, and by that, the state of our application.