Build A Pokémon Application With React - Tutorial

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • Building React applications doesn't have to be about building boring todo lists. In this video we will be creating a React Pokemon application using the latest features of React. This means we will utilize hooks for state and effects instead of classes. By the end of this video you will have a strong understanding of the basics for building out a React application that accesses external APIs.
    🚨 IMPORTANT:
    Learn React Today Course: courses.webdev...
    📚 Materials/References:
    Array Destructuring Tutorial: • Why Is Array/Object De...
    GitHub Code: github.com/Web...
    🧠 Concepts Covered:
    - Creating a React application
    - useState hook
    - useEffect hook
    - How to use axios with React
    - How to organize React components
    🌎 Find Me Here:
    My Website: webdevsimplifi...
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/Web...
    CodePen: codepen.io/Web...
    #Pokemon #WDS #React

Комментарии • 177

  • @simonkalu
    @simonkalu 5 лет назад +122

    You're truly what you called yourself"Web Dev Simplified". You explain complex topics so effortlessly and also your videos are so inspiringly awesome

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +25

      Thank you so much! That really means a lot to me and inspires me to push forward and make more even better videos.

    • @pastorfred2543
      @pastorfred2543 5 лет назад +15

      He made me to understand ES 6 & 7 promises, Async & Await and High order array functions that I staright away implemented them in my project. He is a Hero.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +19

      @@pastorfred2543 Thank you so much! You are truly way too kind to me. All I did was give you the information. You were the one that processed and consumed that information to implement amazing things.

  • @liorocker1
    @liorocker1 4 года назад +58

    Came here after React in 30 minutes, I think this is a very accurate path to move forward as a React newbie, and now everything is more clear to me. Thank you very much for this amazing videos :)

  • @sauer.voussoir
    @sauer.voussoir 4 года назад +5

    I just shouted wow at the end of the video, when all your explanation are very straight forward and very easy to understand!

  • @mohammedalmukhtar8949
    @mohammedalmukhtar8949 5 лет назад +43

    You got sunburn budd? Looks like you had a fun long weekend :P Thanks for the video!!

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +21

      Super sunburnt, but it was a fun weekend so I would say it was worth it.

  • @DeltaNrOne
    @DeltaNrOne 3 года назад +4

    I like how you just dont care about how good the page looks and just codes trough it.
    Awsome video!

  • @amritkumaragarwal9425
    @amritkumaragarwal9425 Год назад +2

    Both ur tutorial and calmness while teaching are adorable :)

  • @____prajwal____
    @____prajwal____ 5 лет назад +18

    Awesome tutorial! loved it! I think we need more of these mini tutorial projects based on API's and many other stuff!

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +3

      Thanks! I really enjoy making these mini projects and have a ton more that I want to do.

  • @rayanfernandes2631
    @rayanfernandes2631 3 года назад +6

    This was one of the best Tutorial i watched... Understood a lot about hooks.

  • @rasifrana
    @rasifrana 5 лет назад +7

    I am definitely taking your React Course. love your videos. simple to understand. Thanks for the contents.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +1

      Thank you so much! I really hope you enjoy the course.

  • @DevashishRoyChowdhury
    @DevashishRoyChowdhury 2 месяца назад +1

    Very great way of teaching ! You taught this so easily I thought it will we very hard

  • @michaelwatson9089
    @michaelwatson9089 Год назад +1

    He wasn't kidding when it comes to learning the core topics of a project. This would of been longer if we built out an actually Pokémon app and got bogged down with html and CSS. This was a good tutorial.

  • @niomi
    @niomi 4 года назад +3

    Thank you so much, I've been scouring the web looking for a simple and easy way to do pagination with react and have gotten very complex answers. Saved me a ton of time!

  • @bennett3625
    @bennett3625 5 лет назад +4

    My man, awesome tutorial! Watched it before I started my work day and loved the concise explanations for everything. Grats on 30k btw!

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +3

      Thank you so much! Reaching 30k amazing subscribers feels unreal. I cannot believe it has happened so quickly.

    • @kneetotheface
      @kneetotheface Год назад

      @@WebDevSimplified how does it feel to look back at this comment and have already passed 1M subs?? 30K < 1M ur such a 1337 h4x0r, my d00d!!!

  • @pjguitar15
    @pjguitar15 3 года назад +6

    I honestly use fetch over axios but because WebDev Simplified is teaching Axios, i guess it's time to use axios now haha

    • @xouchthathurtzx
      @xouchthathurtzx 3 года назад

      I was taught with axios out the gate, so I just stick with it. there are 3 parts:
      .get(url here).then(action after hitting API).catch(error message here)

    • @AlThePal78
      @AlThePal78 3 года назад

      I like axios with async better because you can make it simple. Fetch haves promises and they always render successful even when they are not :)

  • @AlThePal78
    @AlThePal78 3 года назад +1

    Your videos are awesome and it is easier to understand you then my bootcamp i went too

  • @stclark278
    @stclark278 3 года назад +1

    Your tutorials are great to watch. I really enjoy that you do examples that are more complicated than simple todo apps like most other RUclipsrs. I'm impressed at how well you explain what you are doing and why in a easy to understand but thorough way!

  • @mauricemakesmovies
    @mauricemakesmovies Год назад +3

    Just built my first React app, thanks so much Kyle! Heads up: When I tried to use return () => cancel() I got the error that cancel was not a function, it only worked when I removed the parenthesis.

  • @rohitkudalkar92
    @rohitkudalkar92 5 лет назад +2

    sir your videos are really unique and interesting for every frontend developer. thanks for making great videos.

  • @ravishbisht502
    @ravishbisht502 Год назад

    Thanks bro. After 4 years of this code i faced some difficulties running it in my device but i figured it out and really helpful❤

  • @theazimjon
    @theazimjon 2 года назад

    Really nice man, your videos so understandable.I clearly understand complex topics with your videos.I'm happy for find you from RUclips. I wish I had a teacher like you

  • @chloeafp
    @chloeafp Год назад +2

    Such a great tutorial! I wish you'd explain how to get the pokemon images from the API too, I cant figure it out :D

  • @getvivekjoshi
    @getvivekjoshi 5 лет назад +1

    Truly simple and easy to understand, thanks!!!

  • @gojosensei7081
    @gojosensei7081 9 месяцев назад

    Awesome tutorial, such a simple explanation!

  • @adilbaqach9176
    @adilbaqach9176 4 года назад +1

    Bro thank you so much u made my life easier, I wish I could buy ur course right now

  • @moogle-studio
    @moogle-studio 4 года назад +1

    Thank you, you explain everything in such a neat way

  • @waynes9744
    @waynes9744 5 лет назад

    This is my No.1 web dev channel.

  • @shilpavaidya1077
    @shilpavaidya1077 Год назад

    simple and efficient way to start my react app... thank you!

  • @laurenmarcinek8146
    @laurenmarcinek8146 2 года назад

    i spent $12k on a 6 month course and have learned more from you in two weeks than i did that entire class lmfao ily tysm

    • @sovietbot6708
      @sovietbot6708 2 года назад

      $12K? I spent $200 on a year subscription of Codecademy, and they even teach you how to pass technical interviews in their front end career path, and it's at your own pace

  • @pastorfred2543
    @pastorfred2543 5 лет назад

    My Hero in the world of Programming.. This tutorial on #Pokemon is a warming up for the #React Course @ #WDS. Thanks Sir.

  • @antonharbers9264
    @antonharbers9264 4 года назад

    Best Content on the Web right here

  • @israelmanzo8725
    @israelmanzo8725 4 года назад +1

    Beautiful tutorial using hooks. Thank you..!

  • @brownayy
    @brownayy 4 года назад

    Thanks for the vid, I'm currently learning JavaScript as a pre-requisite to learning React, this was a good overview of what building in React actually looks like if that makes sense!

  • @antoniobutcher
    @antoniobutcher 4 года назад +1

    digging the sunburn ;)

  • @Gabriel-V
    @Gabriel-V 2 года назад

    Got sunburned. You workout too? Nice, nice

  • @vashu8472
    @vashu8472 3 года назад

    Learned a Lot! Thanks Kyle

  • @kavithachellasamy2393
    @kavithachellasamy2393 2 года назад

    Simple and more informative Thanks 👍🙏

  • @arturdeandrade7443
    @arturdeandrade7443 4 года назад +3

    Great video! I'm getting really excited about React, can't wait to do more and more projects!
    About this one, I've found a bug and have no idea on what's causing it. I've gone to the last page, which only contains 4 Pokémon, and when I turn back to previous pages they all start showing only 4 Pokémon too. If anyone has encountered this problem too, and knows how to fix it and why it happens, I'd really like to fiind out!

    • @EmporerAxel
      @EmporerAxel 4 года назад +5

      This is caused by the limit parameter being set to 4 by default on the prev field of the response, once you get to the last page. The API seems to reuse whatever limit parameter you last used in any subsequent response. If you put [ setCurPageUrl(nextPageUrl.replace("limit=4", "limit=20"));
      ] in the gotoNextPage and gotoPrevPage methods it should fix it

    • @arturdeandrade7443
      @arturdeandrade7443 4 года назад

      @@EmporerAxel That was it, thank you very much!

  • @conaxlearn8566
    @conaxlearn8566 2 месяца назад +1

    How is it possible that the goto functions at line 41 and 42 would ever be null, since they are declared on line 28 and 32?

  • @tonybrown7847
    @tonybrown7847 2 года назад

    nice overview, nice start to an app

  • @yashraj6565
    @yashraj6565 2 года назад

    Thank you sir. Bring more adv react projects.

  • @worldfromhome4033
    @worldfromhome4033 Год назад

    Awesome as always

  • @JasbirSingh-kp4eu
    @JasbirSingh-kp4eu 3 года назад +1

    How much years of exp have you in web dev? Just curious to know😅😅

  • @danylfernandes6741
    @danylfernandes6741 2 года назад +1

    Wish you had more TypeScript-oriented projects, but your content is great nonetheless, so keep up the good work!

  • @hugod7955
    @hugod7955 4 года назад +1

    how can we do this by using a json document with all information on the pokemon, instead of using an api link ?

  • @rangabharath4253
    @rangabharath4253 5 лет назад

    Awesome. Thank you so much. Very interesting. Keep going. All the best

  • @hassaneoutouaya
    @hassaneoutouaya Год назад

    Thank you so much!

  • @atikehasan5872
    @atikehasan5872 9 месяцев назад

    its great tutorial foreever

  • @coderb8762
    @coderb8762 2 года назад

    thank you bro for good teaching

  • @maxiequa567
    @maxiequa567 5 лет назад

    Outstanding as always Kyle! Would you consider making a companion video creating the backend API with custom data? We have a ton of video tutorials on youtube using third party API data which is great for toy apps but understanding how to structure, code and deploy a bespoke API with the same features as the pokemon one but with our own data, would be full stack heaven :) p.s thanks so much for not doing another todo app!

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад

      I like this idea. I most likely won't make it a pokemon based backend, but I do plan to make some more advanced API tutorials. I personally love making APIs so they are always fun for me.

    • @maxiequa567
      @maxiequa567 5 лет назад

      @@WebDevSimplified Awesome! Yeah agree doesn't need to be pokemon but have similar features within the API such as Limit for pagination and Previous and Next, which we can then populate with custom JSON data.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад

      @@maxiequa567 Great idea. I will add that to my list of ideas for sure.

    • @maxiequa567
      @maxiequa567 5 лет назад

      @@WebDevSimplified Sweet!!

  • @jessyreach7130
    @jessyreach7130 2 года назад +1

    How can we access other properties of this API. Say I want to display the image or the HP, speed etc

  • @calvingonsalves7293
    @calvingonsalves7293 5 лет назад +2

    This is the second youtube channel that I have subscribed to and watched most of the videos after pewdiepie :p . Quality content. I’ll surely be ready for the React course as many tech startups I have interviewed with want to switch over to React and React Native from Angular.
    Thank you :)

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +9

      Thank you so much for the support. Maybe one day I can beat out Pewdiepie :P

    • @theazimjon
      @theazimjon 2 года назад

      What is the first one

    • @calvingonsalves7293
      @calvingonsalves7293 2 года назад

      @@theazimjon Pewdiepie ofc.

  • @valenciawalker6498
    @valenciawalker6498 9 месяцев назад

    Thank you!

  • @joelkuijper
    @joelkuijper 5 лет назад

    Great tutorial as always!

  • @AymenTDD
    @AymenTDD 11 месяцев назад

    Thanks bro

  • @thequickcode5144
    @thequickcode5144 2 года назад

    Yo Man u did a great job

  • @planetmall2
    @planetmall2 4 года назад

    Great job!

  • @stevendornan7979
    @stevendornan7979 5 лет назад

    Thank you :) Starting this right now.

  • @JoeWong81
    @JoeWong81 5 лет назад

    another solid video bro

  • @TheBorjj
    @TheBorjj 4 года назад +1

    Hello, very useful but I have a problem - when I try to fetch the result inside useeffect and then try to use the data it says it's undefined

    • @saumya7747
      @saumya7747 2 года назад

      Hey, I know its too late to ask but if you know the solution to this problem please help me out as well.

  • @rayenhidri584
    @rayenhidri584 3 года назад

    perfect, thx for that

  • @viniciusneto6824
    @viniciusneto6824 4 года назад

    Great video! Thank you! How could I get the pokemon details? I mean... How would the API calls be arranged in a sequential structure? I'm really struggling with these Promises.

  • @the_yugandharr
    @the_yugandharr 8 месяцев назад

    This looked deceivingly easy to me but man React isn't easy!

  • @mehmetemin5404
    @mehmetemin5404 5 лет назад

    amazing tutorial, thanks

  • @NicolayKjarnet
    @NicolayKjarnet 2 года назад

    Great tutorial, but you should've clicked to the end of the list of pokemon's so that we could fully understand the application.

  • @frontmonkey2322
    @frontmonkey2322 4 года назад +1

    now I knew what "Web Dev Simplified" means... I wish you can teach it in Korean.. >< ㅎ

  • @skapha
    @skapha 5 лет назад

    masterclass!

  • @MrWrklez
    @MrWrklez 3 года назад

    thank you!

  • @philipbeauford
    @philipbeauford 2 года назад

    Hi, plz lmk what you are using to append those full screen shots after the descript screencap portion?

  • @RoshanKrSoni
    @RoshanKrSoni 5 лет назад

    You are Amazing bro ❤️👌👌👌

  • @timmy1752
    @timmy1752 5 лет назад

    Hello! Thank you so much! Please make a pokedex application where there is a choice of types of pokemon, also in the field of each pokemon you can see his skills.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +1

      I do not plan to make any pokedex application right now since it is a fairly involved process. That would be a great project for you to practice with, though.

    • @timmy1752
      @timmy1752 5 лет назад

      @@WebDevSimplified Okay, that's okay! Could you briefly help with how to get a date Pokemon where all his skills are and display on the screen?

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад

      @@timmy1752 This is very dependent on your use case. I would recommend looking at the API documentation for the API we use. That will give you all the information you need to implement this idea on your own. The best way to learn is to struggle through and create your own projects.

  • @brsh1190
    @brsh1190 3 года назад

    Hi Kyle, thank you for your work, very useful and impressive. Can you please help how to change the number of items on the first page (the default number is 20 from this api), thank you!

  • @nicocontigliani7141
    @nicocontigliani7141 4 года назад

    thanks alot !!!

  • @toastytomatos5006
    @toastytomatos5006 4 года назад +1

    ok great vid but i keep getting this error when i press next on my button: TypeError: Cannot read property 'protocol' of null

    • @casadogaspar
      @casadogaspar 4 года назад

      Put your code here, so we can see if anything is wrong, or a github link.

  • @injector6926
    @injector6926 3 года назад

    realy good

  • @angiep3883
    @angiep3883 3 года назад

    Can you use class component as opposed to function? (E.g : class PokemonList extends React.Component{} ) ?

  • @vladimirjean
    @vladimirjean 5 лет назад

    Awesome, thanks a lot.

  • @aarav751
    @aarav751 6 месяцев назад +1

    7:42, 16:08, 20:00

  • @aammssaamm
    @aammssaamm 4 года назад

    And if you have another 6 or 8 consecutive events affecting buttons’ visibility do you still dump all these into the same list? How do you resolve the conflicts then? If-else-if-else-if-else-if-else until you get burned out?

  • @StarBattle08
    @StarBattle08 3 года назад

    I need help, after doing *setPokemonData(res.data)* it returns and empty array, but when i save the file 1 more time, it returns the data from the api, but when the app first loaded it returns an empty array

  • @highvibes6116
    @highvibes6116 Год назад

    how would you do this just using fetch() instead of the axios fetch?

  • @ronniesunshine1163
    @ronniesunshine1163 5 лет назад

    I got super confused because I wrote "onclick" like normal javascript but for some reason react uses "onClick". That makes no sense at all. Damn consistency errors. Great video, as always

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад

      Lol. React used camel casing for the names because it makes it easier to read and follow.

  • @ThePredsedatel
    @ThePredsedatel 3 года назад

    im too stupid for webdev. how can i reffer to sprites from poke api?

  • @victoriaestes2087
    @victoriaestes2087 Год назад

    Great video, and very helpful but as of Axios v0.22.0, the cancelToken API is deprecated in favor of using a fetch-like AbortController.
    I'm currently trying to make the new way of canceling work with this project. Would be cool to see a video about it as well.

    • @rishisetpal3537
      @rishisetpal3537 Год назад

      any update to cancelToken API is deprecated replacement?

  • @museitian85
    @museitian85 3 года назад +1

    Does anyone else get this error when trying to create the PokemonList div around 7:52? TypeError: pokemon.map is not a function

    • @thomasblack3415
      @thomasblack3415 3 года назад +1

      I had this issue and then I realized I didn't have useState(['bulbasaur', 'charmander']); on App.js. I only had useState();
      After I fixed that, saved all and then refreshed the page, it worked just fine.

  • @ManpreetSingh-ew8qs
    @ManpreetSingh-ew8qs 3 года назад

    Can't we use useCallback on nextpage and prevpage functions?

  • @botobeni
    @botobeni 3 года назад +1

    dude please blink please don't stare into my soul

  • @bikidas5473
    @bikidas5473 3 года назад

    You saved my day! Thanks a lot

  • @mateuspamaral00
    @mateuspamaral00 4 года назад

    you're so amazing omg

  • @cingetorixhelvetii5172
    @cingetorixhelvetii5172 Год назад

    I started to learn CSS, HTML and JavaScript 2 months ago and now I want to learn react, but this looks too advanced for my level ☹️

  • @digigoliath
    @digigoliath 5 лет назад

    Nice!

  • @mclovin72
    @mclovin72 5 лет назад

    Why not use classes? Sometimes I see classes with components sometimes I see functions. I feel like classes are more structured and easier. Is it because classes are newer to js?

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +3

      I am using functions since functions combined with hooks make doing complex things much easier. It also makes your code much cleaner to follow and read since you can easily break out and modularize your component while class components are quite bulky and hard to modularize. Hooks are also brand new to React so they have taken a lot of the bad things from classes and fixed them.

    • @aammssaamm
      @aammssaamm 4 года назад

      Because none of them knows what classes to built.

  • @jameskirkland4180
    @jameskirkland4180 3 года назад

    I was able to build this with the guide but i am having trouble figuring out how to style the component the right way. any tips on putting this list of pokemon into a box? Im trying to flesh out a pokedex eventually that pulls up stats and images when you select a pokemon from the list

    • @jameskirkland4180
      @jameskirkland4180 3 года назад

      i found i can get style elements throught the return statement in the app.js file, for example putting the list and pagination inside of a section tag and using css to style. is this the correct way of styling in react?

  • @errollsipagan4617
    @errollsipagan4617 4 года назад

    my mvp

  • @lildesiikid
    @lildesiikid 5 лет назад

    I'm getting this error: ./src/App.js
    Line 27:3: 'setCurrentPageUrl' is not defined no-undef
    Line 31:3: 'setCurrentPageUrl' is not defined no-undef
    Line 39:6: 'Pagination' is not defined react/jsx-no-undef
    ideas?

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад

      You need to make sure you import the Pagination component and create the setCurrentPageUrl variable with useState

  • @mustafakosmaz178
    @mustafakosmaz178 3 года назад

    you achieve to simplify web actually

  • @ibrahimkaiser7961
    @ibrahimkaiser7961 4 года назад

    Awesome tutorial and well-described. Though I'm new to react I understood most of it. But I'm facing a problem. As there are 964 pokemon, last page shows 4 pokemon, that's okay. But after that while clicking "previous" --> the page shows 4 pokemon everytime. How can I fix this. TIA

    • @viniciusneto6824
      @viniciusneto6824 4 года назад

      As pointed by @EmporerAxel - This is caused by the limit parameter being set to 4 by default on the prev field of the response, once you get to the last page. The API seems to reuse whatever limit parameter you last used in any subsequent response. If you put [ setCurPageUrl(nextPageUrl.replace("limit=4", "limit=20"));
      ] in the gotoNextPage and gotoPrevPage methods it should fix it

  • @lukeyuanful
    @lukeyuanful 2 года назад

    Is possible to get the project source code?

  • @MasterPigeonXD
    @MasterPigeonXD Год назад

    Did not work for me. Couldnt even get Bulbasaur to statically render

  • @havetrustissue8975
    @havetrustissue8975 2 года назад

    What is Pokemon mean? I thought it would be Pokemon game related app!

  • @rockstarrockyush8502
    @rockstarrockyush8502 4 месяца назад +2

    Any Pokemon fans??