Create a Movie Watchlist with React Hooks, Context API and localStorage

  Рет қаралды 89,234

Matt The Dev

Matt The Dev

4 жыл бұрын

In this tutorial we'll be creating a movie watchlist using React, implementing React Hooks, Context API, storing data in localStorage and fetching data from an external API (The Movie Database).
GitHub Repo with final code (grab the CSS and FontAwesome from here):
github.com/MattDobsonWeb/movi...
Create an account and request an API key for TMDB:
www.themoviedb.org/
✋ Brand New DevUp Club Discord Channel - Join the server for assistance! ✋
/ discord
#react #project #tutorial
VSCode extensions used in this video:
ES7 React Snippets
marketplace.visualstudio.com/...
React Dev Tools Chrome Extension
chrome.google.com/webstore/de...
----------------
Follow me on twitter!
/ mattdobsonweb

Пікірлер: 120
@sebastianramsauer7627
@sebastianramsauer7627 3 жыл бұрын
Wonderful tutorial, I really enjoy that you are quite fast, I had to pause quite often but it was never "boring" since you kept a good pace.
@pratikchand1832
@pratikchand1832 3 жыл бұрын
Damn you should keep uploading these tuts , there was never a moment where I felt overwhelmed by the concepts you taught.
@ParadoxWorks
@ParadoxWorks 3 жыл бұрын
Thank you so much, Matt! This is a world class tutorial! Looking forward to learning to build this project and acquire new react knowledges. Cheers!
@eliseosawyer6132
@eliseosawyer6132 2 жыл бұрын
i guess I'm quite off topic but does anybody know a good site to stream newly released tv shows online ?
@ucielsola
@ucielsola 2 жыл бұрын
THANKS!!! Really thank you so much! I followed step by step, and also added some more functionalities like dark theme switcher, using what I learned with your video.
@ChiYanTse
@ChiYanTse Жыл бұрын
Hi Matt! Thank you so much for this tutorial. I just finish building this project and learn so much. I hope you do more video like this.
@goofy7791
@goofy7791 3 жыл бұрын
Thank you so much. It was one the best tutorials that I ever watched.
@cutyoursoul4398
@cutyoursoul4398 3 жыл бұрын
So little view for a so useful tutorial, thanks a lot man, helped me to build my first decent react project. I builded it with material UI and it came really nicely
@TheHasni69
@TheHasni69 2 жыл бұрын
Hi, do you can share the code please.
@shafiqimtiaz9198
@shafiqimtiaz9198 Жыл бұрын
This is a very comprehensive and well explained video. thank you so much :D
@elisapaulo8630
@elisapaulo8630 3 жыл бұрын
Thank you for the tutorial, it was really helpful.
@OsmAnaa
@OsmAnaa Жыл бұрын
this was so helpful and inspiring. thank you so much Matt, looking forward to seeing more of your awesome tutorials
@mucashamboni6647
@mucashamboni6647 Жыл бұрын
Hi, I just wanted to know how can we make this app personalized for each user. Like a user can login using his password and can edit his own watchlist. In short I want to make separate watchlist for each user.
@ellameta6169
@ellameta6169 3 жыл бұрын
Learned so much from this! Thank you!
@abhashsingh6293
@abhashsingh6293 3 жыл бұрын
superb bro, we need some more tutorial like this next time with e-commerce
@yasine7584
@yasine7584 3 жыл бұрын
very beautiful tutorial bro, thank you
@abshake8
@abshake8 Жыл бұрын
Thanks heaps for this video. I now have a good understanding on useContext, useReducer and localStorage. Hope it helps me pass my interview :)
@al-doori2392
@al-doori2392 2 жыл бұрын
Thank you so much, such an amazing tutorial.
@brunomartins4871
@brunomartins4871 3 жыл бұрын
Great tutorial! Thanks!
@kamaboko1
@kamaboko1 3 жыл бұрын
Very good tut. Learned a lot.
@earthbending4924
@earthbending4924 Жыл бұрын
tq broo, looking foward your project tutorial , its help me to learn autodidact
@edgydodgy3417
@edgydodgy3417 4 жыл бұрын
Great video! Learnt a lot as a beginner.
@MattTheDevYT
@MattTheDevYT 4 жыл бұрын
Thanks! Glad the tutorial helped!
@wesonweb
@wesonweb 3 жыл бұрын
Great tutorial. Explained concepts clearly and made it easy to understand 👍🏻
@wudao88
@wudao88 Жыл бұрын
great tutorial, thank you!
@farajabbas7459
@farajabbas7459 3 жыл бұрын
Thank you for this, yupe thats great !!!!!!!!!
@jaggyjut
@jaggyjut 2 жыл бұрын
Wow. This is a great project.
@dimersonnunez6268
@dimersonnunez6268 3 жыл бұрын
You are amazing dude keep going
@MrVois
@MrVois 3 жыл бұрын
great tutorial!
@reyanahtesham1272
@reyanahtesham1272 3 жыл бұрын
amazing video mate
@nameless798
@nameless798 2 жыл бұрын
Thx for the tutorial
@rohitmahajan2111
@rohitmahajan2111 2 жыл бұрын
Really great learning
@ozzyfromspace
@ozzyfromspace 2 жыл бұрын
Hey Matt, less than a minute in, I already knew I'd found a rare gem of a tutorial 🏆🔥💯 Keep it up mate! And greetings from the USA 👽. edit - I went to your website cuz it sounded interesting, but the website's down 😭
@kameshs4109
@kameshs4109 3 жыл бұрын
Thanks for wonderfull tutorial can make on backend
@TemsiImsirovic
@TemsiImsirovic 3 жыл бұрын
Awesome tut, i learned a lot from this. Can u create some shopping cart tutorial based on context api since i learning to create a shopping cart app. Thank you
@zourdy697
@zourdy697 3 жыл бұрын
good work matt, just got one subs from me lad
@khouloudachour
@khouloudachour 3 жыл бұрын
Thank you so much
@dataisbeauty5512
@dataisbeauty5512 3 жыл бұрын
goood stay with you my dear
@peterhryhoruk
@peterhryhoruk 2 жыл бұрын
awesome voice dude )thx
@abubakar-emumba
@abubakar-emumba 3 жыл бұрын
thanks matt
@obey_giant
@obey_giant 2 жыл бұрын
You should do a e commerce with a shipping cart with react hooks, context and firebase 🙏🏼
@missMiracle7
@missMiracle7 3 жыл бұрын
I love this tutorial! I learned so much by following along! I have a question: what is the difference of doing the fetch API inside the onChange function than using the useEffect? I'm still new to react I found it sometimes confusing and would like to know which way is better for fetching api data
@youshamahmood3183
@youshamahmood3183 3 жыл бұрын
You will want to use the useEffect hook if the data you are fetching doesnt depend on any input field like it is shown here. For example you want to get all the movies ever existed, then you will use fetch inside the useEffect hook, as this hook gets fired upon dependencies. In this case, as the name of the movie needed to be injected inside the query parameter, the fetch is being called after the injection has beed done throught the input field
@oleksiik4473
@oleksiik4473 3 жыл бұрын
Greate, what color theme for VSC do you use?
@vnsn_ngyn
@vnsn_ngyn 3 жыл бұрын
YOUR A CHAMP LAD
@patrickwatson6742
@patrickwatson6742 3 жыл бұрын
Thank you very much ,so exciting tutorial ,but i have just a problem with buttons on movieCard (eye,timer) didn't appear with me ,please help!
@samfallowfield3000
@samfallowfield3000 2 жыл бұрын
Great video, has anyone had any luck adding a genre section to it as well? confusing way the API works with giving them genre ID's instead of just the genre
@daveb7596
@daveb7596 2 жыл бұрын
what extension do you use for the html tags lets you auto fill in the divs with the classNames by putting .whatever
@pedjastojiljkovic7717
@pedjastojiljkovic7717 3 жыл бұрын
Great tutorial, Matt! Just one input, pace is a bit too fast.
@indiarabarreto3925
@indiarabarreto3925 3 жыл бұрын
while was following all of your instructions and making all the functions and everything was working very well and then just stopped working when i created the folder "context" and started to do everything was there and then my app just disappeared
@mucashamboni6647
@mucashamboni6647 Жыл бұрын
Great Tutorial I just wanted to know how can we make this app personalized for each user. Like a user can login using his password and can edit his own watchlist. In short I want to make separate watchlist for each user.
@smithdragon6477
@smithdragon6477 3 жыл бұрын
why not to useeffect to check the movie is watched or in watchedlist in ResultCard component?
@johnkucharsky6927
@johnkucharsky6927 2 жыл бұрын
Hi what do you do for living? Why do you have only 900 subscribers? You definetly deserve more
@MattTheDevYT
@MattTheDevYT 2 жыл бұрын
Thanks John, appreciate that! My day job is as a software developer - making KZbin videos is a side hobby of mine!
@johnkucharsky6927
@johnkucharsky6927 2 жыл бұрын
@@MattTheDevYT do you work remotely? I wrote you in Twitter, what concepts i need to know to find job as a react developer?
@deanambrose6927
@deanambrose6927 Жыл бұрын
Cannot read properties of undefined (reading 'length') any solution?
@florenceelvis7435
@florenceelvis7435 3 жыл бұрын
i tired doing the search button but its not outputing the data, i don't know what is wrong? Could you help?
@gufranahmed2091
@gufranahmed2091 2 жыл бұрын
is there a way to store the context api in the local storage when using next.js, the code basically gives me local storage is undefined since nextjs is server side and local storage is client side.
@akhilbandari
@akhilbandari 2 жыл бұрын
access it after componentDidMount or inside useeffect with empty dependancy array. You can also maybe use a conditional like this typeof window !== undefined, which returns false for applications which do not use window object in client
@mehdikhajavi6495
@mehdikhajavi6495 3 жыл бұрын
why you don't publish more videos about react? your last video was amazing. thanQ
@simoncarriere4086
@simoncarriere4086 3 жыл бұрын
At 23:15, why do we use e.target.value as query parameter instead of the state variable query we set?
@Jumauntages
@Jumauntages 2 жыл бұрын
I think it's because on the first key typed, the query state is an empty string, the query state updates its value after the next rendering.
@Michael-jj8hu
@Michael-jj8hu 2 жыл бұрын
how to fix a nasty error of "Assign arrow function to a variable before exporting as module default" in the reducer ? to change what he's doing at 37:35
@arupde6320
@arupde6320 2 жыл бұрын
upload videos regularly ..
@mustafa8357
@mustafa8357 2 жыл бұрын
My man..
@dlmetadlmytfuckthis
@dlmetadlmytfuckthis Жыл бұрын
i got a error message when i type to search: Cannot read properties of undefined (reading 'length') TypeError: Cannot read properties of undefined (reading 'length') how do I fix this
@ItsRageYT
@ItsRageYT 4 жыл бұрын
hey! what theme is this? thanks for tutorial!
@MattTheDevYT
@MattTheDevYT 3 жыл бұрын
Do you mean my VSCode theme? It's called "Shades of Purple" - it's a good one!
@brandonduong2076
@brandonduong2076 2 жыл бұрын
Hey Matt i was following your example for a similar project but i got an error when i use the onclick button function, "TypeError: e is not a function at Object.fi [as useReducer]" any reason why it says this?
@dawidolino9398
@dawidolino9398 2 жыл бұрын
i've just done this tut and never got the error, the only one thing "wrong" is the outdated word in routing section
@yadnyeshrane7448
@yadnyeshrane7448 3 жыл бұрын
I m facing a issues my api key and all everything is correct but why i am getting the error ---Invalid API key: You must be granted a valid key.
@payonextgen9540
@payonextgen9540 3 жыл бұрын
Hei,can you do tutorial from start to finish,how to create movies website from A to Z.from wordpress scratch to publish website.
@eltonsantosoficial
@eltonsantosoficial 3 жыл бұрын
I found a bug, when you click the Add to Watched button, both buttons are disabled, while if you click the Add to Watchlist button, only the Add to Watchlist button is disabled. How I solve it? :(
@andrei-petrulazar5564
@andrei-petrulazar5564 2 жыл бұрын
it`s not a bug. If you add the movie to the "watched list" means you already watched the movie and you don`t need to add it to the watchlist.
@athiraroyal3744
@athiraroyal3744 3 жыл бұрын
I am at 44:02, why this happning in AppReducer.js "Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export" ?
@laturchasanket6901
@laturchasanket6901 3 жыл бұрын
I didn't really understand your question but let me try to answer it...lol. From what I have seen in multiple videos, while creating app reducer they don't assign the function to a variable or constant and I think that the file name itself is the function name so we can directly export the arrow function an use file name to import the appreducer.
@coreyguitars533
@coreyguitars533 3 жыл бұрын
did you find a solution for this?
@alexanderfilippovich4757
@alexanderfilippovich4757 3 жыл бұрын
Does anybody know how to disable the "add to wached" button by default while I'm in Add commponent?
@agusmahari2755
@agusmahari2755 2 жыл бұрын
like
@michaelvanderloon6392
@michaelvanderloon6392 3 жыл бұрын
Has anyone encountered a cors error with this API? I am encountering a CORS error when trying to call. I believe it has something to do with a bearer token
@theKaminoanru
@theKaminoanru 3 жыл бұрын
53:21 How did you split code line?
@emis12121212
@emis12121212 3 жыл бұрын
I think its done with Prettier
@huyle3866
@huyle3866 2 жыл бұрын
Sir can you tell me extension in js when you typing .header blala
@MattTheDevYT
@MattTheDevYT 2 жыл бұрын
Sure! That extension is called Emmet - it comes built into VSCode and you type your class name and hit the TAB key to create the element.
@JustJohnny
@JustJohnny Жыл бұрын
Might be outdated? Switch doesn't seem to work any longer. Does anyone know what version of React he is using?
@laurenwaknin797
@laurenwaknin797 Жыл бұрын
Switch was replaced with Routes
@2010giant
@2010giant 2 жыл бұрын
I follow the whole tutorial but not sure how much I understand... maybe 30%? Is this app good for a resume? or is it too advanced?
@MattTheDevYT
@MattTheDevYT 2 жыл бұрын
Hi David, thanks for watching! This is a great starter project if you've created some basic React projects already - lots of basic React starter projects don't use the Context API (state management) like we do in this tutorial. If you're very new to React it might be worth taking an even simpler starter tutorial - after a few basic starter projects you may begin to understand why we need to use the Context API. This project will look great on your resume! It shows usage of state management and grabbing data from an external API! Cheers!
@2010giant
@2010giant 2 жыл бұрын
@@MattTheDevYT Thank you for replying! After I do some searching and re-watching this tutorial, now I can understand 65% up, try to get a frontend job before the end of this year.
@kaze01234
@kaze01234 Ай бұрын
What to write in Application Url for API request?
@kaze01234
@kaze01234 Ай бұрын
nevermind I got it
@subashvelmurugan3677
@subashvelmurugan3677 2 жыл бұрын
Hey Matt ,I am receiving status_code: 7 status_message: "Invalid API key: You must be granted a valid key." success: false in search api Can you plz respond and help me to debug this error.
@abshake8
@abshake8 Жыл бұрын
Your API key is not valid. You need to use a valid API key from your tmdb account. Or it could be that you are not putting .env.local file to the right location which is outside the 'src' folder.
@Musikberoende
@Musikberoende 2 жыл бұрын
I got an error message: "'Switch' is not exported from 'react-router-dom'". I changed the import of Switch to Routes instead, and the syntax for this is a bit different. import {BrowserRouter as Router, Routes, Route} from "react-router-dom"; So it looks like this: /* More links */
@priyanshumishra7900
@priyanshumishra7900 Жыл бұрын
yeah things have changes now in v6
@mucashamboni6647
@mucashamboni6647 Жыл бұрын
Hi ! I just wanted to know how can we make this app personalized for each user. Like a user can login using his password and can edit his own watchlist. In short I want to make separate watchlist for each user.
@laurenwaknin797
@laurenwaknin797 Жыл бұрын
Switch was replaced with Routes
@Aravind_Ap
@Aravind_Ap 2 жыл бұрын
How to run this can anyone help
@george4577
@george4577 3 жыл бұрын
Im at 46minute. to testing the add to watchlist for the first time. Im getting 'addMovieToWatchlist is not a function'. any ideas?
@mohammadrafey2981
@mohammadrafey2981 3 жыл бұрын
same problem
@mohammadrafey2981
@mohammadrafey2981 3 жыл бұрын
edit: @george in the globalstate file where he is passing "addMoviesToWatchlist" within the value of the GlobalContext Provider change it to something like addMovies: addMoviesToWatchlist. For some odd reason it should work with just addMoviesToWatchlist as hes giving the key and value the same name.. but it doesn't for me. However, that did work for me so you can try it out.
@malozyali
@malozyali 3 жыл бұрын
same
@adroitpersonn2356
@adroitpersonn2356 4 жыл бұрын
www.themoviedb.org/ this website is not working. can you suggest any similar sort of other website with whom we can carry on this project?
@MattTheDevYT
@MattTheDevYT 3 жыл бұрын
That's strange - it's working for me at the moment, maybe you caught it whilst it was down? You just need to create an account over there and then request an API key and you should be good to go!
@Abogida11
@Abogida11 3 жыл бұрын
I am keep on getting this error "Cannot read property 'length' of undefined" I am on 26:35
@goofy7791
@goofy7791 3 жыл бұрын
How it is your code, mate?
@deanambrose6927
@deanambrose6927 Жыл бұрын
did you get any solution?
@SH-lt2iv
@SH-lt2iv 3 жыл бұрын
35:20
@thedyslexicwebdev1654
@thedyslexicwebdev1654 2 жыл бұрын
21:00 46:33 59:03 remove btn 1:03:14 , 1:07:03 1:19:01 1:21:30
@yushaeraza2629
@yushaeraza2629 2 жыл бұрын
I made my own version of movie watch list that's full stack mern web application
@mucashamboni6647
@mucashamboni6647 Жыл бұрын
Hi ! I just wanted to know how can we make this app personalized for each user. Like a user can login using his password and can edit his own watchlist. In short I want to make separate watchlist for each user.
@yushaeraza2629
@yushaeraza2629 Жыл бұрын
@@mucashamboni6647 that’s what my app allows
@mucashamboni6647
@mucashamboni6647 Жыл бұрын
@@yushaeraza2629 can you share the link to GitHub repo please
@yushaeraza2629
@yushaeraza2629 Жыл бұрын
@@mucashamboni6647 I tried but links are not allowed in the comments section
@mucashamboni6647
@mucashamboni6647 Жыл бұрын
@@yushaeraza2629 why are my comments getting deleted 🥲
@arupde6320
@arupde6320 2 жыл бұрын
upload videos regularly ..
@delanyeong8666
@delanyeong8666 2 жыл бұрын
When I tried refreshing the page at Watch List or Watched after adding a movie, the app turns blank. The console error shows "Uncaught TypeError: watched.map is not a function at Watched". Same goes for watchlist.map or watched.find/watchlist.find. HELP!!!
Learn React Hooks: useContext - Simply Explained!
15:46
Cosden Solutions
Рет қаралды 122 М.
Beginner React.js Coding Interview (ft. Clément Mihailescu)
36:31
Ben Awad
Рет қаралды 2,1 МЛН
Шокирующая Речь Выпускника 😳📽️@CarrolltonTexas
00:43
Глеб Рандалайнен
Рет қаралды 11 МЛН
He tried to save his parking spot, instant karma
00:28
Zach King
Рет қаралды 19 МЛН
React Movie App Tutorial
42:49
Chris Blakely
Рет қаралды 162 М.
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Software Developer Diaries
Рет қаралды 67 М.
The JavaScript Survival Guide
14:47
Fireship
Рет қаралды 714 М.
Google Data Center 360° Tour
8:29
Google Cloud Tech
Рет қаралды 5 МЛН
Don't Use Create React App in 2023
3:22
Theo - t3․gg
Рет қаралды 78 М.