Dude, you're helped. I had a problem with that push of undefined, and you solved it. Many thanks.
@h3webdevtuts3 жыл бұрын
Glad I could help. Thanks for watching :)
@fmaylinch3 жыл бұрын
Oh, thanks for the trick of moving Router to index.js! Btw, now React Router v5 has this syntax:
@h3webdevtuts3 жыл бұрын
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 :)
@jackfrost89693 жыл бұрын
This is exactly what I was looking for.
@h3webdevtuts3 жыл бұрын
I'm glad that I was able to help. Thanks for watching :)
@jackross44483 жыл бұрын
YOU SOLVED MY PROBLEM WITHIN THE FIRST 3 MINUTES THANK YOU
@h3webdevtuts3 жыл бұрын
Glad I was able to help. Thanks for watching :)
@alimirhashimli27272 жыл бұрын
Thanks, understandable. It would be better if you used setTimeout, so people do not get confused with a sudden redirect.
@kelp-chip3 жыл бұрын
Thanks so much! Moving the Router tags from my App.js file to my Index.js file solved my problem! :)
@h3webdevtuts3 жыл бұрын
Glad you solved the issues you were having. Thanks for watching :)
@luxgroove4803 жыл бұрын
Amazing tutorial! You made it very simple and easy to understand. Thank you!
@h3webdevtuts3 жыл бұрын
Thank you so much :)
@kw4nx3 жыл бұрын
Best explanation on useHistory
@h3webdevtuts3 жыл бұрын
Thank you, much appreciated :)
@calvinbarajas51443 жыл бұрын
Fantastic video. When can you use history.back() and history.forward()? I haven't seen many people use those. Thank you.
@h3webdevtuts3 жыл бұрын
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 :)
@franzlagler55673 жыл бұрын
I want to thank you for your awesome explanation. It immediately solved the issue I had :)
@h3webdevtuts3 жыл бұрын
I'm glad I could help. Thanks for the kind words :)
@wale666562 жыл бұрын
How can I render only login page in react-router-dom,i dont want the header and footer page to appear in login page
@h3webdevtuts2 жыл бұрын
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 :)
@wale666562 жыл бұрын
@@h3webdevtuts yes it's help thanks
@Anmol1774 жыл бұрын
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?
@h3webdevtuts4 жыл бұрын
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 :)
@zeeshanhaider90654 жыл бұрын
Which theme are you using??
@h3webdevtuts4 жыл бұрын
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 :)
@LeFlaneurFilms3 жыл бұрын
Thank you!!! You made it so easy to understand
@h3webdevtuts3 жыл бұрын
Thanks :)
@rohitrockytgaming89663 жыл бұрын
how to use usehistory in class component.
@h3webdevtuts3 жыл бұрын
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 Жыл бұрын
You saved my day!! thank youu.
@phantazzor3 жыл бұрын
been block one day on the cannot define! love you...
@h3webdevtuts3 жыл бұрын
Glad you got it working now :D Thanks for watching :)
@phantazzor3 жыл бұрын
@@h3webdevtuts yeah don't put the -save if in yarn to install
@TheMonkeyButte4 жыл бұрын
Brilliant!
@h3webdevtuts4 жыл бұрын
Thank you :)
@shivashankar60434 жыл бұрын
Thanks
@h3webdevtuts4 жыл бұрын
Glad it could help, thanks for watching :)
@yt-1161 Жыл бұрын
so for what purpose do you need useHistory. you are not explaining anything
@elconrel96652 жыл бұрын
Thx for video! It's better to use Link to={''} or useHistory ? useHistory is outdated ?