Fetch an API to Display on Page - React Tutorial 22

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ • 18

  • @codebreakthrough
    @codebreakthrough  2 роки тому

    ⚛ FREE React Course (download & bonus content) - calcur.tech/free-react-course
    React UA-cam Playlist - calcur.tech/react-playlist
    Code - github.com/CalebCurry/react

  • @keithrfield
    @keithrfield 11 місяців тому +1

    This series is exceptional. You have a great way of explaining and illustrating complex concepts. And I appreciate your sense of humor.

  • @metasal
    @metasal 2 роки тому

    I wrote my first React Component using useState, useEffect and Fetch. Thank you Caleb.

  • @eliyahutarab4862
    @eliyahutarab4862 2 роки тому +2

    And you can also create .env file in the frontend and just get the information of the kry from there and that way no one can get their hands on that

    • @cannonkalra7133
      @cannonkalra7133 11 місяців тому

      there is nothing secret on the frontend, browser has all the code, the object where you load the key from the .env file

  • @laxlyfters8695
    @laxlyfters8695 2 роки тому

    Also just a FYI I have definitely seen some frontend developer interviews where u are asked to make a fetch request and render some data in the frontend and make a little cool site.

  • @spanac76ks
    @spanac76ks 2 роки тому

    You’re back

  • @MrValVet
    @MrValVet 7 місяців тому

    lol 'it's going to be ugly but you're already seeing me'

  • @eliyahutarab4862
    @eliyahutarab4862 2 роки тому +1

    Please make a video on how to build complex api with the mern stack

  • @TheCacoVenom
    @TheCacoVenom 2 роки тому

    I have people using async on fecth, do you a have a video about fecth that explain differents way of using them

  • @spanac76ks
    @spanac76ks 2 роки тому

    Yay

  • @cyriacus73
    @cyriacus73 Рік тому

    👍

  • @spanac76ks
    @spanac76ks 2 роки тому

    👩‍👩‍👧‍👧👨‍👩‍👧‍👧👨‍👩‍👧👨‍👩‍👧👨‍👨‍👧‍👧

  • @bugrakarabudak7135
    @bugrakarabudak7135 2 роки тому

    i am first

  • @rl6382
    @rl6382 Рік тому +1

    return (

    Here is an example of a random definition :
    {word.map((meaning) => {
    return {meaning.defintions[0].definition}
    })}

    ); does not work for me, I get an error of undefined reading, It;s because the API call data hasnt been set to word yet? how is yours working?

    • @rl6382
      @rl6382 Рік тому

      I fixed it by adding an empty arry to the useState method call like so =useState = ([]); and the error fixed. Why is this not an issue for you?

    • @rl6382
      @rl6382 Рік тому

      I think I may have solved this.. but not entirely sure, let me know what you think, So i believe I was getting an error and had to provide the array [] syntax as a param to useState() because my PC is processing the return code block faster than the API can respond, so it gave me an undefined error until I added that []. What is your opinion. I am still learning but this is how i can imagine in the background it fixed

    • @lfc5times130
      @lfc5times130 Рік тому +1

      Add dependency array and if you are getting undefined reading map error, try something like this
      {word && word.map(()) => so on... sometimes if there's no data in the api, you will get this map error. Trying adding word && word.map. It will work.