How To Redirect In React - React Router V5 Tutorial | Redirecting, useHistory...

How To Redirect In React - React Router V5 Tutorial | Redirecting, useHistory...

PedroTech

3 года назад

193,576 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Raluca Avram
Raluca Avram - 25.04.2023 10:34

Thanks a lot!

Ответить
Scrimm
Scrimm - 13.01.2023 00:53

Thank you! Simple! useNavigate makes it even SIMPLIER!!!

Ответить
Good time Films
Good time Films - 13.01.2023 00:06

Inglês brabo!! Ótimo video Pedrão!!!

Ответить
Logan Hasty
Logan Hasty - 26.10.2022 01:48

useHistory is now depracated. Of course they'd make it obsolete after I go through this whole video and test it...

Ответить
::INITER::37::37::
::INITER::37::37:: - 10.10.2022 04:24

thank

Ответить
Shubham Mukherjee
Shubham Mukherjee - 25.08.2022 15:31

Thanks, PedroTech!

Ответить
Saurabh Daswant
Saurabh Daswant - 24.08.2022 18:20

thanks man it worked! : )

Ответить
Kelan Hamman
Kelan Hamman - 24.08.2022 05:28

Thank you! so helpful!

Ответить
neranjana priyashantha
neranjana priyashantha - 11.08.2022 20:02

You are my second react teacher. Thank u so much

Ответить
phú quảng
phú quảng - 09.08.2022 20:31

.0123

Ответить
Prajakta badgujar
Prajakta badgujar - 26.07.2022 17:29

thanks you , i watched 2,3 videos and i wasnt getting it .... now i know what to do

Ответить
RAJ KIRAN KELANGI
RAJ KIRAN KELANGI - 20.07.2022 14:40

Please share the source code

Ответить
sridhar 1
sridhar 1 - 15.07.2022 17:03

bro its not working for me will you share a code

Ответить
Matthew - Full Stack Developer - Blockchain
Matthew - Full Stack Developer - Blockchain - 07.07.2022 00:49

stop fucking wasting time with the explanation and just go.

Ответить
issam benhassine
issam benhassine - 03.07.2022 16:39

thx

Ответить
chidanand md
chidanand md - 23.05.2022 21:10

Super

Ответить
Ray Rimika
Ray Rimika - 23.05.2022 10:14

it's still not working please help

Ответить
Roy Slapped
Roy Slapped - 23.05.2022 09:17

Yeah but how can you redirect to external urls like going to facebook?

Ответить
thecyrusj13
thecyrusj13 - 22.05.2022 04:06

This was how I thought things worked but I wasn't sure. Thanks for the clarification.

Ответить
The Soul Crisis
The Soul Crisis - 21.05.2022 07:49

It's amazing to me something as basic and central as linking to other pages loading data has so much inconsistency between the methods to achieve it and many don't work for some reason depending on how the data is structured and being fetched. The way you said you were surprised at how much of an issue this was for newcomers is very much expected to me, I'm new to React and the official docs don't go into it from what I see, while I try referencing material from the official site for React Router and it's been annoying to get working right now.

Ответить
babu Siir
babu Siir - 14.05.2022 12:08

Yes this video is very helpfull, but i had doubt bro. after filling the form can we redirect the profile page ??

Ответить
Sona Mohialdin
Sona Mohialdin - 10.05.2022 18:18

This short tutorial is so good

Ответить
1491_Hà Gia Đạt
1491_Hà Gia Đạt - 07.04.2022 16:28

rat hay minh da lam dc <3

Ответить
TopG SpoT
TopG SpoT - 11.03.2022 08:00

if anyone's page shows empty when you use <Route> ( <Router>
<Routes>
<Route path="/login" element={<Login/>} />
</Routes>
</Router> ) use this code and thank me later (because of Router-Dom version 6)- - - -Happy Coding everyone

Ответить
keme
keme - 24.02.2022 08:33

You are one of the best brothers...

Ответить
Majula Dark S.
Majula Dark S. - 23.02.2022 18:57

Ótimo vídeo mano, só faltou uma legenda em pt-br.

Ответить
Pascal Lim
Pascal Lim - 09.02.2022 22:31

Thanks for your vids Pedro ! You're explaining very well, you're the best !! 😁

Ответить
Utkarsh Gupta
Utkarsh Gupta - 31.01.2022 10:54

please tag the react dom version ..

Ответить
Amaury Peralta
Amaury Peralta - 30.01.2022 01:51

This works well react router versión < 6, but how this would be with React router V6?

Ответить
Léo Freitas
Léo Freitas - 28.01.2022 04:06

Dude, I would give you a kiss if I could, thank you so much!!!

Ответить
Uttam Khuntia
Uttam Khuntia - 15.01.2022 19:13

I get memory leak problem...but I can't able to solve this

Ответить
A Burk
A Burk - 15.01.2022 03:35

where can I get the code

Ответить
Ajay
Ajay - 29.12.2021 02:38

Very simply put

Ответить
Alexander Barrera
Alexander Barrera - 23.12.2021 00:19

this only works with functional views. how do you implement a redirect a component?

Ответить
Wael Sta
Wael Sta - 22.12.2021 18:30

I think the useHistory hook is no longer available in the new react router dom version

Ответить
sudhir kalivarapu
sudhir kalivarapu - 22.12.2021 14:01

bro your videos are good please show how to reroute to login page if local storage is empty using latest version of react
and

Ответить
elrazor
elrazor - 16.12.2021 04:06

Rookie question but why do I get blank pages when I refresh my app. I have to kind of restart my app or login again, to navigate within the app. But moment I refresh the page, it's blank. Is it as I haven't implemented useHistory throughout my app.

Ответить
alaaa sassii
alaaa sassii - 05.12.2021 15:22

one thing I learnt today is if your app didn't show other pages and you use in Route "component" you can use "element" hope it Works <3

Ответить
smellycyborg
smellycyborg - 04.12.2021 16:36

yeah none of this worked for me.

Ответить
Sowmya Grace
Sowmya Grace - 23.11.2021 20:07

This video was really helpful. I am a beginner and was very confused about this concept. Thank u

Ответить
Afx Crush
Afx Crush - 11.11.2021 06:50

I'm using a component <Header /> in my router. All my routes has this Header, but I want a single Route to not have it... How can I achieve it?

Ответить
Dakota Fabro
Dakota Fabro - 10.11.2021 02:44

Thank you so much! This was so helpful!

Ответить
InfiniteBeast
InfiniteBeast - 09.11.2021 10:00

thank you so much. This really helped.

Ответить
Ramon Paolo Maran
Ramon Paolo Maran - 27.10.2021 17:21

Cara, uma pergunta.
Quando o usuário loga, e eu salvo o token dele, eu mando ele de volta para a página home, só que, o "navegador" eu acho, não entende que ele está logado entende. Eu preciso dar um F5 na página, para dai aparecer a mensagem de usuário logado na página home
Ou seja, eu preciso dar um reload na página
Já tentei usar o windown.reload no código do login, porém, não dá certo
O que eu tenho que fazer para a página Home ser realmente recarregada ?

Ответить
Öomkäar khamitkar
Öomkäar khamitkar - 27.10.2021 13:34

bro you save my life it work

Ответить
Radojicic Ugo
Radojicic Ugo - 27.10.2021 08:23

Thanks man :)) i love you

Ответить
just a casual programmer
just a casual programmer - 21.10.2021 06:54

I agree! the docs for the react-router-dom is very confusing for beginners, this video is the best way to explain the concept of redirect in the simplest way.

Ответить