Build a Weather App in React JS | React JS beginner Tutorial

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

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

  • @crazycat2969
    @crazycat2969 4 года назад +87

    14:00 Guys u don't even need that long code to build date. You can just easily take the date object and convert it to string (date object return day, month year...)
    For example:
    let date = String(new window.Date())
    date = date.slice(3,15)
    In my case date returns: May 25 2020

    • @axeljacob4632
      @axeljacob4632 4 года назад +9

      ||
      let today = new Date().toLocaleDateString()
      ||
      let today = new Date().toDateString();

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

      I have these issues. What did I do wrong?
      'api' is assigned a value but never used no-unused-vars
      'day' is assigned a value but never used no-unused-vars
      'date' is assigned a value but never used no-unused-vars
      'month' is assigned a value but never used no-unused-vars
      'year' is assigned a value but never used no-unused-vars
      Unexpected template string expression no-template-curly-in-string

    • @alexsmith-rs6zq
      @alexsmith-rs6zq 4 года назад +4

      You don’t have to but it allows you to format the date in the way you want it to display. It’s a stylistic choice not bad practice.

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

      @@gallant7661 in vscode get the extension eslint. then hover over the code with "no-unused-vars" and hit quick fix then click the disable no-unused-vars for the whole file.

    • @NoobMaster-nr3jw
      @NoobMaster-nr3jw 3 года назад +2

      no way it Elon Musk!!!!!! 😱

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

    Thanks for this tutorial bro. While going through the Weather API site, I noticed that it provides info in Hindi also which is my native language. I added lang parameter in my api query and changed the days and months name in Hindi. Voila! I have a weather app in Hindi now.
    let months=["जनवरी",'फरवरी', 'मार्च','अप्रैल','मई','जून','जुलाई','अगस्त','सितम्बर','अक्टूबर','नवम्बर','दिसम्बर'];
    let days=["रविवार",'सोमवार','मंगलवार','बुधवार','गुरुवार','शुक्रवार', "शनिवार"]

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

      my code not working! please help! i am using npm. ..cant fetch Api

  • @Haldinyar
    @Haldinyar 4 года назад +117

    I learned a lot about CSS in this React tutorial lol.

  • @thatdudelos9074
    @thatdudelos9074 3 года назад +53

    Trust me I learned way more from you than you will from me. The reason the transition wasn't working in your CSS code was due to not adding the "s" per the documentation for the transition property. Rather than just having
    transition: 0.4 ease-out;
    it should actually be
    //added an "s"
    transition: 0.4s ease-out;
    This was an amazing walkthrough and lesson. Thank you!

  • @MohamadMohamad-pl4eb
    @MohamadMohamad-pl4eb 3 года назад +2

    you are the only youtuber that make real projects, keep it up.

  • @dremiq6670
    @dremiq6670 5 лет назад +411

    let months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
    let days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

    • @Thejusticier44
      @Thejusticier44 4 года назад +12

      True hero

    • @dremiq6670
      @dremiq6670 4 года назад +2

      @@Thejusticier44 Kappa

    • @tejasvigupta07
      @tejasvigupta07 4 года назад +4

      Initially I thought why this comment got so many likes but now that I am building my own App

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

      @Joshua (Nakjun) Paik i got u my g

    • @bhagyashingale5663
      @bhagyashingale5663 4 года назад +13

      {new Date().toDateString()}

  • @khuloodfahad7485
    @khuloodfahad7485 4 года назад +4

    Thank you so much for this tutorial, I loved it! and BTW you have a lovely personality which make this video more enjoyable.

  • @arshanaatapattu
    @arshanaatapattu 2 года назад +2

    This is very begginer friendly, keep up the good work. Thanks a lot Tyler.

  • @mohanedesmail
    @mohanedesmail 5 лет назад +108

    Transition Error you must type s after the number
    transition: .4s ease;

    • @TylerPotts
      @TylerPotts  5 лет назад +16

      My bad... I was so tired when I recorded this... haha Thanks!

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

      @@TylerPotts Hope you got some rest :D

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

      @@TylerPotts About the audio: in your video editing software, delete the trash audio channel, then make the right mono channel as stereo.

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

      it still not worked

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

      thanks bro

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

    This was super helpful! I'm currently interviewing for a position that uses React, and I've never done much coding with it.

  • @deekshithanand3094
    @deekshithanand3094 4 года назад +2

    I had never done this much CSS in my previous tutorials! Thanks, buddy learnt a lot...

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

    Hi! Great tutorial! You fotgot the “s” of seconds in the transitions atributte.
    Answer: transition: 4 east-out;
    Correct Answer: 4s east-out;

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

      Thanks for that!

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

      Thanks

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

      Any idea how I’m going to save everything so i can open it after I’ve closed it?

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

    I am a beginner and I really loved this in my initial learning.

  • @buncha1499
    @buncha1499 5 лет назад +6

    Great tutorial, thank you bro! One tip that is a great new feature, you can use optional chaining to replace the ternary for truthy or falsy results...

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

    Great tutorial. I like how there was no fluff in it.

  • @cannacare4467
    @cannacare4467 3 года назад +9

    "And the arrow function which takes the D....heh...heh...heh" LOL Made my day.

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

    i didn't know how to use free apis because everytime they had this api key stuff and i used to get stuck all the time. Also I learned how to query and onKeyPress handler thing and search only when the user hits enter🔥.... Thank you so much❤️

  • @calebcadainoo
    @calebcadainoo 4 года назад +18

    32:22
    in the index.css it should be
    transition: 0.4s ease;
    you left out the s or seconds for the timing

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

      this worked for me. thanks!

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

    thanks for this awsome tutorial, that was clear, well explain, never too slow or too fast ! Great job !

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

    for that transition i used
    -webkit-transition: all 0.2s ease-in;
    and it worked pefectly. tnx for tutorial its great

  • @WebDevSurvivalGuide
    @WebDevSurvivalGuide 5 лет назад +10

    For anyone following along who cannot get the transitions to work, you need to make the ease out transition be 0.4s (s for seconds) instead of just 0.4.
    Nice tutorial!

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

      Hahaha I was a little tired when I recorded this... my bad xD Thank you :D

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

      Why isn't this comment at the top? Thank you :-)

  • @mustknow58
    @mustknow58 4 года назад +4

    You are awesome dude 💓
    Love from India

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

    I Love your channel! Thank you for all your tutorials

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

    Thank you for the video! You're great at explaining and straight to the point

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

    Thanks, man. It was a good night

  • @santiagotorres8680
    @santiagotorres8680 4 года назад +4

    Thanks for sharing us your knowledge! you are amazing... I've learned a lot thanks to you :)

  • @PeachiiWubs
    @PeachiiWubs 3 года назад +2

    thank you this was DOPE! learned a lot on css and react.

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

    "The arrow function takes the d" *laughs- that got me XD. Great content mate, keep it up🤘🤘.

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

    Learned a lot from this tutorial, helped me build mine !! New sub

  • @wesamal-shaibani8157
    @wesamal-shaibani8157 3 года назад

    Thanks for the awesome tutorial. I just added a few lines to view different picutures depending on the weather

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

    you just import everythings you need in react, it's wonderful

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

    lovely tutorial .... straightforward to understand and easy to follow thank you... thumbs up from me

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

    Well done. I learned a lot.Thanks!

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

    Great Video Man. Thanks!

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

    Quick, to the point and EXCELLENT work man. I learned a lot from this video. God bless you. (y)

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

    amazing tutos ! amazing channel ! kepp going ♥

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

    thank you so much! greetings from Mexico

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

    This is very therapeutic

  • @NERO-ez1mn
    @NERO-ez1mn 3 года назад

    holy shit the IF ELSE statements are so advance for me haha and the TYPE OF should have a seaparate tutorials and FOR LOOPS please we need an in depth noob lesson here haha if it is ok for you please. the way you code is mindblowing in a good way. a brain workout haha

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

    Great video 🔥...
    The way to fix transition - add a unit ('s') after the transition value in index.css file...
    Like - transition : 0.4s ease-out;

  • @okaytrippy
    @okaytrippy 4 года назад +9

    at 4:33 time in video
    FROM WHERE HAVE YOU TAKEN THE BASE !!!
    after the key input

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

    Thank you so much brother
    Thank you so much
    The code was clean and very easy to understand.
    Thank you again

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

    I declared the transition for app warm class and it worked

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

    Really Nice content broo, it helps me alot :)

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

    I’m ready, will be here in 12 hours! :-)

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

      Whoops, I'll have to head home and set it for 3 😁😂

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

      Tyler Potts Hahaha did you mean to set it for 3PM?

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

      @@JohnCrypdoe It was supposed to be 1PM UK time today... xD

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

    Greate tutorial learned both react and CSS also

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

    For the person who saw React yesterday first time that took time to understand

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

    Great tutorial, I learned a lot.

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

    God Bless you i learned a lot from this video thanks mate

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

    Great Tutorial

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

    Thank you so much ,it was useful for me

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

    Cool Video! Keep making

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

    Awesome tutorial, thx

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

    Works perfectly!!! (: thanks a lot

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

    Great project 👍from 🇳🇬

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

    thanks for the awesome video , really like it

  • @daitoakyoeiken7735
    @daitoakyoeiken7735 3 года назад +3

    The transition property should have a 's' appended to time as per documentation. However,I was using Firefox so I still didn't get the transitions. Then I viewed in Edge and it worked fine.

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

      Yeah I was just being blind xD

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

    verry clean thanks alot sir

  • @rushdude87
    @rushdude87 4 года назад +8

    Great video, very helpful!
    I find your syntax highlighting incredibly useful, mine is just orange white and blue. It makes it difficult for me to distinguish variables etc.
    Is that a VS Code extension or a theme of some sort?

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

    You genius thanks alot !

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

    thanks! awesome!

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

    That is a amazing work, thank you!

  • @Rad88ek
    @Rad88ek 3 года назад +3

    Fun fact: Transition with background-image is not working with firefox. For those, who also got confused why its still not working after solving the problem with "s".

  • @mihai-alexandrubujor9826
    @mihai-alexandrubujor9826 4 года назад +7

    Hey! I have a small issue. At 27:28 when you type the name of the city and press enter I don't get anything, my page remains blank(not really blank, but you get the point). Do you have any idea on why is this happening?

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

      It needs an active internet connection, that could be one reason, another reason is that the city doesn't exist, like due to a typo or something

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

      Hey!
      I have the same issue here, how did you solve it?
      Thanks a lot

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

    great video! thanks very much :)

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

    Thanks for the tutorial.

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

    Amazing. Thanks!

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

    nice tutorial mate

  • @aachalthapa6028
    @aachalthapa6028 3 года назад +2

    Hi, Thank you for the video. Where did you get the base api url from? 4:28

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

      Hey here's the documentation: openweathermap.org/api

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

      @@TylerPotts Thank you, I followed everything from the video and cross checked each line from the source code of your github as well but I'm not getting my search result. If I type any city it's just giving me a blank page.

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

      @@aachalthapa6028 Go to api tab at the top and then click on subscribe link beside the current weather api

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

    I love It! Ty very much

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

    thank you so much sir this amazing content

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

    Nice video!

  • @AnandGiri
    @AnandGiri 2 года назад +2

    excellent...
    btw, the weather should have been {weather.weather[0].description} to give correct data

  • @leomonz
    @leomonz 4 года назад +7

    got teh openweather api and key myself, but getting 401 unauthorized error...

  • @darknessfalls6478
    @darknessfalls6478 4 года назад +6

    You forgot to put the unit of 0.4 Correct one:0.4s ease-out

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

    I know this is super late but the reason why the transition didn't work at the end is because you forgot to add the 's' unit to the transition time

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

    Thank you!

  • @igboelijude6387
    @igboelijude6387 3 года назад +2

    Hello Tyler , I keep getting this “unexpected ( in promise ) expected a json “ error in my console. Please any help?

  • @hashimshah8035
    @hashimshah8035 4 года назад +4

    where did you get the base: "url" from? at 4:34

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

      same question

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

      @@manishakanyal751 After you confirm your email on openweathermap you will get another email that has a sample url. I believe that's where he got it from.

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

    Css transition is working because of (0.4) is missing "s" for seconds....
    I highly appreciate your efforts and this video, thank you..I have learn a lot...Thanks again..
    I have been doing vanilla JavaScript for alomst 2 years now... Now I am transition to ReactJs and truth be told...
    JavaScript in react is something else, I had to start thinking JavaScript in "state management" ... Which is not an easy transition at all..
    All along I have been thinking the only way to handle AJAX is only through the use of useEffect... I knew I could do it in another way...Now you just unlocked my mind there...
    And Other thing, ES6 ternary operator...I've been asking myself...How on earth can I return more then one thing, Today I got my answers...Thanks again..

  • @The-Empowerment-Engine
    @The-Empowerment-Engine 3 года назад

    thank you for this

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

    Arrow function takes the d...hahahaha
    Thanks for the tutorial, really appreciate it.

  • @tamirpolyakov1122
    @tamirpolyakov1122 4 года назад +4

    for the transition you forgot the s 0.4s

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

    On line 15, for the transition, you are missing the 's' It works with: -transion: 0.4s ease-out;

  • @prudhvichinnam1488
    @prudhvichinnam1488 3 года назад +3

    Put s after 0.4

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

    bro started laughing at himself for saying to take in the d lmaoooo

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

      Gotta enjoy the little things 😁

  • @AbdulBasit-kx3ju
    @AbdulBasit-kx3ju 4 года назад +5

    Well explained but one thing more you would need to do is to keep each function separate in their own components. As you are instructing a component based library.

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

    I dont know why, i did exactly the same way that you did but if i'm searching any cities i dont get anything in my console...

  • @AMITYADAV-nw9mx
    @AMITYADAV-nw9mx 3 года назад +1

    Thanks for the video Tyler. Wanted to ask that, can we make the background change using just vanilla javascript(not using react)?

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

    const getDate = new Date();
    const currentDate = getDate.toDateString();
    and use it by {currentDate} and it works and its simple

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

    thank you man

  • @CK-uv9zu
    @CK-uv9zu Год назад

    great video

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

    I am not able to fetch weather api data from the key and base written by you. How I write as I am using free version of Open weather map

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

    What extensions are you using? How did you get from .search-box to the div and className being automatically populated?

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

      That's called Emmet, it's built into vscode

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

      @@TylerPotts Is Emmet the extension name or are you saying that functionality is built into vscode? Thank you for the help btw!

    • @adend5029
      @adend5029 4 года назад +2

      @@TylerPotts I got it working by going to settings > emmet > include languages and then I added "javascript": "javascriptreact" as an item.

  • @siddharthdeb8303
    @siddharthdeb8303 4 года назад +4

    From where did you get the base api url?

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

      Same question. Did you get the answer?

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

    Its a very wonderful tutorial,thanks man
    I have a question,how to change the resolution just like in your video
    mine was stretched following the resolution of my laptop 1366x768

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

      Try adding "max-width: 500px;
      margin: auto;" these two lines to the .app class in css

  • @Hamza-so9wx
    @Hamza-so9wx 3 года назад +1

    wow thanks

  • @NoobMaster-nr3jw
    @NoobMaster-nr3jw 3 года назад +1

    I have a bug can you plz help me
    instead of the date coming out this is what comes out "${day} ${date} ${month} ${year}"
    15:45

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

      use ` symbol .... it's just above tab button

    • @NoobMaster-nr3jw
      @NoobMaster-nr3jw 3 года назад +1

      @@arbros9093 thanks you so much i never thought of that 🤦‍♂️

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

      @@NoobMaster-nr3jw it's okay

  • @CodingFire
    @CodingFire 3 года назад +2

    You went to mountain XD 🤣

  • @mrohitsingh
    @mrohitsingh 4 года назад +4

    How to get api Base url?