How To Redirect in React Tutorial - V6+

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

КОМЕНТАРІ • 79

  • @westernpigeon
    @westernpigeon 2 роки тому +12

    that’s insane dude i was just having a problem with Navigate and useNavigate last night and i didn’t understand the difference and then you release this video!!!! thanks !!

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

      Glad I could help!

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

      @@PedroTechnologies i need help, i see this works for functional components, but how does it work in class components?

  • @gabrielsimiownato
    @gabrielsimiownato 2 роки тому +5

    Cara, eu juro que fiquei de cara quando descobri que você é brasileiro. Estava me aventurando vendo vídeos seus sobre React e JavaScript e você simplesmente tem os melhores tutoriais do tema. Valeu ai por toda ajuda que você proporciona a todos nós. Tive que estudar por conta própria lendo as documentações pra aprender como usava o novo react router v6 e certamente se você tivesse postado o vídeo alguns dias antes, teria me salvado mais uma vez kkkk. Mas mesmo assim vou ver seu vídeo para ver a sua didática e tenho certeza que não vou me arrepender!!

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

    keep these videos coming bro even if you aint getting that many views we got your back and you are really helping us we will support you

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

    Looked out many places about how to redirect inside a component in v6 but didn't find the correct answer.
    Got it here thanks :)

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

    this is a very good tutuorial, simply implies that Navigate is declarative while useNavigate is imperative.

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

    Thank you lol , had bumped into your old one lol, code was breaking , glad u made an update , thanks mate!

  • @Dapr071
    @Dapr071 8 місяців тому +1

    I’m doing an online shop for a final project and I need to have the navigation done with router. When I do it puts me a error of Cannot read properties of null (reading ‘useRef’) i don’t know how to do it. Can someone help me please?

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

    Brilliant work once again from you. Thank you for bringing such good video on Navigation. Please do such video on Pagination in React because the way you explain will reach to many developers

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

    Pedro, i owe you a benz man. You keep me going fr, i really appreciate your work. You should add a link so we can buy you a cup of coffee.

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

    Thank you so much for this tutorial.

  • @Alex-zi1gb
    @Alex-zi1gb Рік тому

    Great video! Short and easy to understand. Thanks for that!

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

    THANK YOU !!!! you are a life saver !!

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

    Predo!!!!!!!!!!!!!!!!!!!!!!!!!!!! you the man, hey man, when i see u in person , remind me to get you a cold one, I don't care if you do not drink , that day you will take a glass for me. Shout out to you man

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

    Pls give me any suggestions or makes video on its. Your videos are very informative.

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

    It's very helpful for me. Thanks for your video!

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

    Thank you Pedro for clear my confusion

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

    Great video. Really helped me in my project. Thankyou

  • @61.pranamyajoshi23
    @61.pranamyajoshi23 Рік тому

    Thanks man, This was really helpful

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

    Pure Gold !!!

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

    Nice video bro. Can you please tell what extension do you use for code completion suggestions. I hope you get what I mean

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

    Brilliant explanation. Thank you so much!

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

    Kudos to your interest and excellent explanation. Keep doing such tutorials. Best channel to learn React concepts in lucid way is @Pedro tech

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

    Awesome Tutorial. Would love to see you in another tutorial with implementing Coinbase Commerce in React. Haven't seen any tutorial about it in youtube. Hope you consider it. Thank you

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

    Hello sir I got a question.
    Lets say there is a page A which is protected routes. If any user is not logged in and visit that A page, it will automatically redirect to the Login page. After login how would I send that user to previous page where he was before. I tried to search and found one solution using useLocation but it’s quite confusing. It would be great if you make a video.

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

      React router keeps track of the location history. The useLocation hook can be used to do something like this I believe. I might be able to make a video on this, but in the meantime I would say to keep searching it :)

    • @Chriss-cn1ch
      @Chriss-cn1ch 2 роки тому

      navigate(-1)

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

    brilliant video thanks for sharing !

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

    ohh my god how can I thank you for this...thanks man!!!

  • @정수영-q4w
    @정수영-q4w 2 роки тому

    hi!!! thank you so many videos :) i wanna see video of REDIS!! If u have much time then could u make video of REDIS?

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

    You are a gem

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

    Nice lesson Keep teaching

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

    How do you recommend to learn and master React? Any react idea that i can try from scratch by myself?

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

    Hi Pedro will you ever do a tutorial on how to use nextjs with typescript? Much appreciated! Your videos are super helpful.

  • @gabrielmaciel2891
    @gabrielmaciel2891 2 роки тому +4

    Pedro se der, faz um tutorial de react router de como fazer uma rota pra um modal, eu consegui implementar aqui mas n sei se foi da melhor forma, e no UA-cam não tem nenhum tutorial disso.

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

      Geralmente quando eu uso modals eu nao crio uma rota nova, porem o que vc pode fzer é ter nested routes. Eu fiz um video neste assunto.

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

      @@PedroTechnologies Vou ver, o modal que eu fiz precisava mostrar os dados de um User que vinha da Api e que poderia ser acessado pelo id, era oq o desafio pedia pelomenos kk, ai tive que criar uma rota pra cada

    • @Davi-wv8mi
      @Davi-wv8mi 2 роки тому

      rota para um modal, geralmente e tira e poe componente, existem libs que gerenciam esses steps, ou voce pode fazer do seu jeito

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

    Sir this is exquisite

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

    Thank you brother..... ❤

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

    I tried to use the useNavigate but it gave me an error saying useNavigate is called in function "navigate" that is neither a react function component nor a custom react hook function.
    Why is that

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

    thank you pedro

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

    How to redirect in class component buttonHandler after some api response

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

    Thanks a lottt!

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

    In the about page where you used an if statement to check if its true or not, can i use a Tenary operator like {goToContact ? : null}

    • @Chriss-cn1ch
      @Chriss-cn1ch 2 роки тому

      Yea I usually use it to Check if user is logged in the routes.
      Path login for example
      Element={user? : }}

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

    awesome video. can you tell me what font do you use in vscode

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

    Super helpful

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

    GOAT

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

    Hey bro which kind of project I make in react.

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

      whatever you’re interested in

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

      In my opinion, try doing whatever you feel like you will have fun doing. I remember when I started I would just come up with crazy ideas and keep trying until I was able to do it.

  • @SXia-gd5vb
    @SXia-gd5vb 2 роки тому

    so fantastic

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

    Hey. Do you a video showing how to create and deploy an API? I'd like to create my own API (just for consuming data) and deploy it using Netlify

  • @dragosp.7635
    @dragosp.7635 2 роки тому

    How do I redirect to an external link like facebook?

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

    thank you so much

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

    Pedro can you make a video where you talk about filtering objects depending on category using checkboxes please.

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

    Thank you

  • @РасулМырзакулов-э8и

    Intro music name please?

  • @augischadiegils.5109
    @augischadiegils.5109 2 роки тому

    ❤️❤️❤️❤️❤️❤️

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

    Are you open to freelancing?

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

    Bro will you try to create a payment with payment gateway using express and react ?

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

    Your previous one didnt work. Hope this one will.

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

    I bet it takes literally less than a minute to tell how react router dom Redirect works.

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

      Yeah, but tbh this is an explanation video and not a walkthrough. At least for me, in the beginning, I didn't like just reading documentation since I wouldn't fully grasp the subjects. I try to make videos explaining how I would've liked to learn when I started. There are many different types of learners, this video might not fit your type. I appreciate the constructive criticism! I honestly have made so many changes to my channel because I listened to comments like yours, and it has improved how i teach :)

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

    ur quality and voice has significantly impropved.

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

    Thanks again for your help and support 🙏 👍 😊 🫂 😊

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

    Hello PedroTech . Why does nobody ever tell us how they know that the URL for the Contact page(that is contact.js) is "/contact". Unilike in flask where we explicitly write the URL before the function, I never see it in your code. So how do you know it's "/contact"

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

      We define the url when we define our routes. Every component has a path prop in it. U just have to write which path u desire there and it will work. For example:

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

      @@PedroTechnologies I understand it now. Thank you so much.

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

    Tools to get cc easy in yt leakfullz

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

    Thank you so much

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

    thank you