How To Create A Navbar In React With Routing

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 193

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

    Without even watching the video, I already know this was EXACTLY what I was looking for today from you...weird how life works out like that.

  • @ThourCS2
    @ThourCS2 2 роки тому +9

    Breaking down tutorials in components this way is the way to go.
    Thank you so much for this.

  • @NiaNic425
    @NiaNic425 2 роки тому +13

    This is so great for portfolios! I was just considering moving my web portfolio from the old php mysql to react since I dont have much data to use for database anyway. Learning react, about routes and being able to update portfolio all at the same time with this vid thank you so much man!

  • @luthfijuang4433
    @luthfijuang4433 Рік тому +2

    Thanks so much bro, you are helping me so much on my first project as an intern, keep going bro and i always will be your subscriber.

  • @smile4self
    @smile4self 5 місяців тому +2

    short, simple and straight to the point. its 2024... Still very useful and relevant... thanks for breaking this down to the simplest...

  • @krishgarg2806
    @krishgarg2806 2 роки тому +192

    Just for info: There is a NavLink component in react-router which will add "active" class if that link is currently active automatically. Saves some boilerplate code!

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

      Hey, I just found out about NavLink. What do you think its usecases?

    • @terragady
      @terragady 2 роки тому +18

      @@cookiemachine obviously nav bar items :D

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

      I was about to say the same thing

    • @dave6012
      @dave6012 2 роки тому +7

      activeClassName was deprecated in react-router-dom v.6

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

      @@dave6012 you use an inline function passed as value of a prop instead

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

    Thanks Kyle! I was working on my Company's official page and this video saved my day!

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

    I don't know if you know this, but your content saves lives.
    Thank you so much!

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

    The final part of your tutorial saved me from a big problem, thanks, you taught me so much!

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

    Thank You so much, was trying different docs and couldn't make it work, Finally found your video and made it done

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

    Thanks Kyle!! I have been stuck at react routing errors. My pages won't show on my home page but after watching your video. I got solution. Keep growing brother.

  • @CrystalButterfly_Sadhanad
    @CrystalButterfly_Sadhanad 8 місяців тому

    I am a beginner for using react. Your explanation helps me a lot.

  • @balrogmorgoth2360
    @balrogmorgoth2360 3 місяці тому

    Thank you, i adjusted my own html and css code into this, and it works well!

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

    Searched this morning "AlpineJS router" and Kyle released this video 5 hours later 🤔. Thank you so much for the first router solution. I am amazed at how these things are so easy to you

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

    Thanks!

  • @ayandandlovu5253
    @ayandandlovu5253 6 місяців тому

    If you only knew how I struggled with this today? 😭 Thank you sm❤

  • @muwahid2380
    @muwahid2380 9 місяців тому

    actual goat video only making this comment to help u in the algorithm cause u deserve it

  • @mirkoat22
    @mirkoat22 4 місяці тому

    Thank you! These videos really help out, keep up the great work!

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

    Easy to follow along, and I like you show how to route with and without react-router-dom. Thanks for the tutorial.

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

    Hey Kyle, thanks for making this. I've come across your channel over the last couple of weeks and finding if really useful! Brilliant.

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

    Thank you brother, router was doing my head in.

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

    Thankyou so much i was stuck on this for hours 😭😭

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

    I'm a fan of the teaching style :D

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

    Great video bud. Really nailed the params of an exercise I am working on for a bootcamp with only a little bit of adjustment. Subbed today so look forward to see what you release in the future!

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

    Thank You VERY VERY much. Great explanation. U are a gifted teacher and thanks one more time

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

    You are amazing! Thanks for simplifying web dev in such a clear way!

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

    A few more that kind of video and i'll fall in love with React)

  • @Babisimo
    @Babisimo 2 роки тому +3

    ty for simplifying the web for me

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

    Bro Thanks a lot this is what I've been looking for.

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

    Thank you, I have learned a lot of things from today's video. Good luck with your work.

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

    Thanks a lot. after watcing your amazing learning video, i am able to resolve problem related to React Router.
    once again, Thanks a lot..........................

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

    Excellent tutorial, helped a lot with my react website nav bar menu.

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

    You are really helping me with react !

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

    Finally, I've been waiting for a new video to come. What time do you post videos? (2d, 5d, 1w or something else)

  • @rajireddyaleti6346
    @rajireddyaleti6346 2 роки тому +8

    Hey Kyle, I'm a fan of yours. I like the way you make the content much simpler to understand.
    Can you start some Javascript(React) tooling-related videos to make them more understandable? I don't know most of the things why we need some libs as dependencies and soon in a while in 2yrs to 3yrs they are deprecating/outdated

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

    This came at the right time! Thanks buddy!

  • @SaliAalaNabiyak
    @SaliAalaNabiyak Рік тому +3

    for the hook to get the current locatin you can just use one hook it is : useLocation()
    it's gonna return an obj containing the pathname which we are looking for so the after importing the hook your code should look like this :
    const location = useLocation()
    let path = location.pathname

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

      I'm sure he knows that, but you can't give away too many trade secrets in a free video.

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

    Keep up the great work!!

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

    Thank you so much for the video. It really helped me with my assingment.

  • @ethiocode298
    @ethiocode298 2 роки тому +13

    I think we can use NavLink instead of Link for active state

  • @merabet.faycal
    @merabet.faycal 2 роки тому +1

    easy and great as always , Thank you !

  • @empoweredsouls-relaxingmus6074
    @empoweredsouls-relaxingmus6074 2 роки тому

    Thankyou so much you made my day sir

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

    Works, thanks!

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

    You're the GOAT 🙌🏽

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

    Thank you so much for your video it helped me out alot.

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

    Thank you so much, it was exactly what I was looking for. What a great tutorial!

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

    Good job!

  • @utvikler-no
    @utvikler-no 2 роки тому

    you are a legend! Thanks!

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

    Thank you for sharing your knowledge

  • @Smurfis
    @Smurfis 8 місяців тому

    Thank you for show-casing this as we can now use this to create an amazing display system perhaps you could make it more of a hamburger menu! Thank you!

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

    Thanks, I love your angel hair. Keep it up !

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

    This saved me!! thank you

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

    18:05 can someone explain why doing this is necessary... if your website only has a few tabs

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

    Thanks for this knowledge!

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

    Thanks Chief, I have been struggling to find the reason why i'm getting a blank white page for two weeks now and i just found out i didn't add the BrowserRouter into the index.tsx root render function

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

    Nice work ✌️

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

    Hi, can you make a video of vanilla js routing? great videos!

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

    Excellent vid, really clear and help[ed me fix a problem that I'd been battling with all day :-)

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

    Thank you great video. Your a machine! Appreciate the information
    Even Your hair is even doing 100 km/hr.
    Mine does 30 km/hr like a kids school zone! Just like my coding skills.

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

    ERROR in [eslint]
    src/NavBar.js
    Line 25:24: 'path' is not defined no-undef
    Hello, what does this mean?

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

    crazy good video !

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

    Interesting how you have the same ideas I have, like organizing the components the router references as "pages".

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

    Thanks a lot for this tutorial

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

    please make more videos on React

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

    Great tutorial

  • @8ack2Lobby
    @8ack2Lobby 2 роки тому

    05:00 can anyone clear this concept? Why active class have to go above hover for it to work?

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

    Kyle, I have a problem. I am hosting my website with firebase the navbar works awesome but if I try to write the url it sends me to the 404 page. How I can make it when I write a url with the page to load automaticaly??

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

    How would you organize a multi page react app? I've seen you've separated the pages in a folder. What about components of these pages? CSS and all the good stuff?

  • @B.O.L.A
    @B.O.L.A Рік тому

    Hi I don't know if you're listening I am trying to create a navbar inside an exisiting react app are you able to assist ?

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

    This is a great video and tutorial! However, is a way where you can transfer data between these pages like if someone clicks a link on your pricing screen it brings it to a new screen to pay with the payment plan selected

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

    great job bro

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

    npm i react-router-dom installed an additional package-lock.json and package.json. I suspect this course needs an update for 2023? At this point it killed my app and I couldn't continue.

  • @rehyannsaini
    @rehyannsaini 4 місяці тому

    Thanks Buddy

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

    Thanks Kyle.

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

    can you also use something like component={Home} when you write the routers?

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

    Great 👍

  • @Smith-fg1qb
    @Smith-fg1qb 6 місяців тому +1

    I get most of this. The only only I’m confused about is why you put display flex in .navbar a

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

    Omg thank you so much

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

    Please make a video on nested routes

  • @KimberlyRuzivoMunyoro
    @KimberlyRuzivoMunyoro 6 місяців тому

    Many thanks!!!!!

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

    how do you use this concept with a nav list from data? Am I supposed to know all of the links ahead of time to create routes?

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

    Thanks kyle

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

    Thank you big boss

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

    thanks for the video baby

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

    hello Kyle! Hope you are fine i wanted to ask that this code can be written in Notepad ++ ?

  • @j.villasmil9575
    @j.villasmil9575 Рік тому

    What if I don't want to show the nav in a specific page, like the login for example?

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

    how react router is able to chagne the components without causing the page reaload ?

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

    great video thx

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

    It Very Easy ... Can't believe react is so easy ...
    or it's your magic ...
    who know !

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

    Hello! I am new to React, I am creating a website with a pathname like: where I compare my state with my URL. Can this tutorial be helpful?

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

    What do you mean by active state? What are the differences when you implement it so that it is in such a state compared to the previous routing implementation without react router?

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

      Nevermind, I now understand it as allowing the active class concept.

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

    Hello! thank you for this tutorial but I have one problem, when I add tasks on my first nav (todotask) and then I go to my second nav (timer) and then I go back to the first nav, it will reloaded and the added task is gone. can you help me what can i do to fix this? thank you!

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

    In my case I have buttons I want to put in the header. Any ideas?

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

    best practice react folder structure and state management sir

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

    Thank you

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

    Can you make a video about blazor?

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

    how can I make this navigation bar stay at the top of the screen even though the user is scrolling down?

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

    Could you make tutorial video on React unit testing ?

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

    how does the mavbar re-render? when you click on the Link, and it's color changes

  • @6ixty9
    @6ixty9 10 місяців тому

    hey could you make a tutorial on firebase auth where we can block users from acessing other parts of site if they are not authenticated .... plz