useHistory - React

  Рет қаралды 52,712

h3webdev

h3webdev

Күн бұрын

Пікірлер: 42
@zenlanfleek6580
@zenlanfleek6580 3 жыл бұрын
Dude, you're helped. I had a problem with that push of undefined, and you solved it. Many thanks.
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
Glad I could help. Thanks for watching :)
@fmaylinch
@fmaylinch 3 жыл бұрын
Oh, thanks for the trick of moving Router to index.js! Btw, now React Router v5 has this syntax:
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
No worries. Yeah I had same issue with index js file a lot before, learned it the hard way :D Yeah u can do it either way, your way is better imo if u plan on passing props otherwise I would always use . Thanks for watching :)
@jackfrost8969
@jackfrost8969 3 жыл бұрын
This is exactly what I was looking for.
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
I'm glad that I was able to help. Thanks for watching :)
@jackross4448
@jackross4448 3 жыл бұрын
YOU SOLVED MY PROBLEM WITHIN THE FIRST 3 MINUTES THANK YOU
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
Glad I was able to help. Thanks for watching :)
@alimirhashimli2727
@alimirhashimli2727 2 жыл бұрын
Thanks, understandable. It would be better if you used setTimeout, so people do not get confused with a sudden redirect.
@kelp-chip
@kelp-chip 3 жыл бұрын
Thanks so much! Moving the Router tags from my App.js file to my Index.js file solved my problem! :)
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
Glad you solved the issues you were having. Thanks for watching :)
@luxgroove480
@luxgroove480 3 жыл бұрын
Amazing tutorial! You made it very simple and easy to understand. Thank you!
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
Thank you so much :)
@kw4nx
@kw4nx 3 жыл бұрын
Best explanation on useHistory
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
Thank you, much appreciated :)
@calvinbarajas5144
@calvinbarajas5144 3 жыл бұрын
Fantastic video. When can you use history.back() and history.forward()? I haven't seen many people use those. Thank you.
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
It's not used that much as far as I'm aware. The reason I don't use it is mostly you either have link to go to specific page, or things like buttons to redirect to home page. I can see a good use for history.back(), example would be if you had a page of 20 products for example and opening a product would give you more information of it, so if you wanted to go back to see all products it would be useful to have, but at the same time history.push('/products') would do the same thing. Hope that helps. Thanks for watching :)
@franzlagler5567
@franzlagler5567 3 жыл бұрын
I want to thank you for your awesome explanation. It immediately solved the issue I had :)
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
I'm glad I could help. Thanks for the kind words :)
@wale66656
@wale66656 2 жыл бұрын
How can I render only login page in react-router-dom,i dont want the header and footer page to appear in login page
@h3webdevtuts
@h3webdevtuts 2 жыл бұрын
Hi, there are multiple ways to do it, I'm not sure what the structure of your app is. From what you have posted, the simplest way to do is instead of what you have now, put header and footer in each component, so in your case both home page and checkout page, then login won't have it, hopefully that helps. Thanks for watching :)
@wale66656
@wale66656 2 жыл бұрын
@@h3webdevtuts yes it's help thanks
@Anmol177
@Anmol177 4 жыл бұрын
Hi, thank you for the tutorial. Suppose if I were to define a history object on my App component where I have enclosed the App component with Router instead of BrowserRouter and I wanted to push using the same history object in my components then would I use the useHistory hook? How does the useHistory hook provide me with the history instance defined in the Router component?
@h3webdevtuts
@h3webdevtuts 4 жыл бұрын
Hey, I'm not sure what exactly ur trying to accomplish. If there's any issues feel free to join the discord and ask there. Thanks for watching :)
@zeeshanhaider9065
@zeeshanhaider9065 4 жыл бұрын
Which theme are you using??
@h3webdevtuts
@h3webdevtuts 4 жыл бұрын
If I remember correctly this should be the one I was using at the time marketplace.visualstudio.com/items?itemName=ahmadawais.shades-of-purple , hope that helps. Thanks for watching :)
@LeFlaneurFilms
@LeFlaneurFilms 3 жыл бұрын
Thank you!!! You made it so easy to understand
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
Thanks :)
@rohitrockytgaming8966
@rohitrockytgaming8966 3 жыл бұрын
how to use usehistory in class component.
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
It should be the same exact thing if I'm not mistaken, if you have any issues let me know and I'll check. Thanks for watching :)
@Ingenieureninformatique-et7zb
@Ingenieureninformatique-et7zb Жыл бұрын
You saved my day!! thank youu.
@phantazzor
@phantazzor 3 жыл бұрын
been block one day on the cannot define! love you...
@h3webdevtuts
@h3webdevtuts 3 жыл бұрын
Glad you got it working now :D Thanks for watching :)
@phantazzor
@phantazzor 3 жыл бұрын
@@h3webdevtuts yeah don't put the -save if in yarn to install
@TheMonkeyButte
@TheMonkeyButte 4 жыл бұрын
Brilliant!
@h3webdevtuts
@h3webdevtuts 4 жыл бұрын
Thank you :)
@shivashankar6043
@shivashankar6043 4 жыл бұрын
Thanks
@h3webdevtuts
@h3webdevtuts 4 жыл бұрын
Glad it could help, thanks for watching :)
@yt-1161
@yt-1161 Жыл бұрын
so for what purpose do you need useHistory. you are not explaining anything
@elconrel9665
@elconrel9665 2 жыл бұрын
Thx for video! It's better to use Link to={''} or useHistory ? useHistory is outdated ?
useParams - React
14:23
h3webdev
Рет қаралды 34 М.
React router with hooks ( useHistory useParam  useLocation )
15:56
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
10 React Hooks Explained // Plus Build your own from Scratch
13:15
Fireship
Рет қаралды 1,4 МЛН
Netflix Removed React?
20:36
Theo - t3․gg
Рет қаралды 61 М.
Squid Game: Season 2 | Filming The Games | Netflix [ENG SUB]
9:41
Netflix K-Content
Рет қаралды 2 МЛН
Simple Frontend Pagination | React
19:13
Traversy Media
Рет қаралды 483 М.
Protected Routes in React using React Router
15:40
freeCodeCamp.org
Рет қаралды 345 М.
Load More Pagination React
10:07
h3webdev
Рет қаралды 28 М.
Random Quote Generator - React
16:12
h3webdev
Рет қаралды 9 М.
React Hooks Course - All React Hooks Explained
1:26:21
PedroTech
Рет қаралды 1,1 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН