Тёмный

React router with hooks ( useHistory useParam useLocation ) 

techsith
Подписаться 148 тыс.
Просмотров 78 тыс.
50% 1

React-router-dom with Hooks, guild to routing in react js. new react-router version 5.1.0 and later.
#react #router #hooks
*My Udemy Courses
www.udemy.com/js-masterclass/
www.udemy.com/course/react-ho...
Follow me for technology updates
* / techsith
* / techsith
* / techsith1
* / 13677140
* / patelhemil
Help me translate this video.
* ru-vid.com_cs_...
Note: use translate.google.com/ to translate this video to your language. Let me know once you do that so i can give you credit. Thank you in advance.

Наука

Опубликовано:

 

15 окт 2019

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 93   
@Techsithtube
@Techsithtube 4 года назад
** Please Join: facebook.com/groups/reactLearning/ **
@elorabourel2320
@elorabourel2320 3 года назад
Hey @techsith, do you have a Discord server ?
@davidfischer9186
@davidfischer9186 4 года назад
Replace just overwrites the location instead of adding another. So if they go to an invalid url, you can replace the url with a 404 then when they go back it takes them to the last valid url... that's what I've used it for...
@celidee
@celidee 4 года назад
So glad I found this, been using v4 without the hooks and this implementation is far superior.
@Techsithtube
@Techsithtube 4 года назад
Thanks for Watching!
@KDcoo
@KDcoo 4 года назад
Thank you! I really love your tutorials! Very easy straightforward and quick to implement :)
@NeoCoding
@NeoCoding 4 года назад
Easy and useful as always. Thank you for enlightening.
@jeromelanteri6469
@jeromelanteri6469 3 года назад
quick and clear. Perfect, thank you, i didn't know for useLocation and useHistory.
@Techsithtube
@Techsithtube 3 года назад
Glad it helped!
@kim92se64
@kim92se64 4 года назад
so much thanks for this "React router with hooks" awesome tutorial. TC
@Techsithtube
@Techsithtube 4 года назад
Thanks for watching!
@akashpal9691
@akashpal9691 3 года назад
Awesome video . The comparison between react hooks routing and normal normal is pretty clear here.
@scottsaccenti
@scottsaccenti 3 года назад
This was incredibly helpful. Thanks for this video. Subscribed.
@NoOne-zl4qb
@NoOne-zl4qb 4 года назад
Thanks, just what I was looking for...
@anacatarinagoncalves8714
@anacatarinagoncalves8714 3 года назад
Great explanation, helped me a lot!! Thank you
@nahuelaraujo6914
@nahuelaraujo6914 4 года назад
Thank you very much sr! Very practical :D
@kannank3319
@kannank3319 4 года назад
Thanks for the video. Very much useful
@mickeyvershbow4814
@mickeyvershbow4814 2 года назад
Great lesson, thanks so much!
@brilliantchicken4873
@brilliantchicken4873 2 года назад
Beautifully explained, thank you
@beksultanomirzak9803
@beksultanomirzak9803 2 года назад
Great, I liked your lesson ad explanation thank you
@abeechr
@abeechr 4 года назад
Excellent! I’d love to see you do a video on protected routes with hooks.
@skullcan
@skullcan 4 года назад
Nice video. Thanks!
@manoharachennuru8151
@manoharachennuru8151 3 года назад
Great content. Thank you
@ristolibera1295
@ristolibera1295 2 года назад
Very intuitive!
@tradewithdani122
@tradewithdani122 3 года назад
tnx dude u solved all of my problems
@oz9957
@oz9957 2 года назад
thank you, that was useful ♥
@harshawijendra5903
@harshawijendra5903 4 года назад
Love your tutorials. Can you do a series on Next.js ? Preferably with Redux. There's not a single solid series on Next. That'll be really helpful if you can.
@kylehenson2259
@kylehenson2259 4 года назад
this tutrial very help me tank you . kepp going
@Techsithtube
@Techsithtube 4 года назад
Thanks for watching Mostafa. Keep on learning!
@majjisrinu3518
@majjisrinu3518 4 года назад
Thanks for the video Sir
@priyankaamahour
@priyankaamahour 4 года назад
Thank you so much!
@gopideveloper4375
@gopideveloper4375 4 года назад
Awesome. ThanQ
@AakashShahFromGoogle
@AakashShahFromGoogle 4 года назад
This is a great video.
@Techsithtube
@Techsithtube 4 года назад
Thanks for watching Aakash
@fernandoaugusto8394
@fernandoaugusto8394 4 года назад
Thanks !!
@muhammadqamar2283
@muhammadqamar2283 4 года назад
Make my day :)
@DEV_XO
@DEV_XO 4 года назад
Nice! :)
@rajeevbhosle1580
@rajeevbhosle1580 3 года назад
you are awesome
@rizkyiqbal5959
@rizkyiqbal5959 3 года назад
U save my life
@erichkenupp2640
@erichkenupp2640 2 года назад
Tu é um mito
@AakashShahFromGoogle
@AakashShahFromGoogle 4 года назад
It would be great if you make a unit test with jest video for the same application using hooks you showed here.
@Anas_Alaqeel
@Anas_Alaqeel 3 года назад
Replace can take you to another component or another route but you can't go back, because it replaces the whole location under the hood to only the current location, and this is useful when you want to make a login page and after the user logged in he cannot go back to the login page and there many cases for Replace but this is one of them
@dungvu8790
@dungvu8790 3 года назад
Thank you
@saktikantasenapati2508
@saktikantasenapati2508 4 года назад
Thanks a lot for this video series. Also can you make some videos on reselect, immer and react-boilerplate ?
@ajoypatra882
@ajoypatra882 3 года назад
Learn a lot!! It will be helpful if you can create some video on npx-create-library to reuse react components.
@brahimelmokaouim4299
@brahimelmokaouim4299 3 года назад
Super react tutorial on youtube
@digletwithn
@digletwithn 3 года назад
Ladies and gel man!
@mahendranath2504
@mahendranath2504 3 года назад
precise, to the point, clear, thank you so much,,, can you do a video on best practice in react, I like you content its great, A happy subscriber, can you do a video on reacting tool-kit pls, a concept like createAsyncThunk, createEnityAbopter, i has some goodies like reselect, thunk and state normalization, thanks for the video 👍
@roiunger7796
@roiunger7796 3 года назад
Sir, I adore you
@Techsithtube
@Techsithtube 3 года назад
Thanks for watching!
@preethamandakshatha60
@preethamandakshatha60 3 года назад
Could you please do an entire tutorial on use history, like the usage of go, replace, block, the action so on......
@dd13mm
@dd13mm 3 года назад
Thank you for the video. And how can the useLoccation() be used in a class Component ?
@mrmatt8998
@mrmatt8998 4 года назад
really handy hooks when we need location and params without withRouter HOC. want to try personally but i haven't change or adopt hooks yet so it can't be done in class components
@momentswithmanisha
@momentswithmanisha 4 года назад
Please make a video about unit testing using jest and enzyme for react application.
@shaikkhaja2225
@shaikkhaja2225 4 года назад
Can you please make video on HashRouter.
@daliborpetric8288
@daliborpetric8288 4 года назад
Replace is used for when you login for example, you push user to the Home page, and when he clicks back button in browser, it doesn't returns him to the login page/route. Just like deletes it from history.
@adnantariq3346
@adnantariq3346 4 года назад
Sooo How would I use something like a useLocation in a CLASS component? and if that answer is, we don't use such hooks in a class, and only in a functional component. What or how do i implement that in a Class component.... Anyways thanks for sharing your insights, love and I mean LOVE this channel :)
@adnantariq3346
@adnantariq3346 4 года назад
never mind got my answer "this.props.location.pathname" ty
@reinvanimschoot3314
@reinvanimschoot3314 4 года назад
Mind sharing your vs code setup? Looks really good!
@Techsithtube
@Techsithtube 4 года назад
github.com/gitmil/new-react-router-with-hooks
@reinvanimschoot3314
@reinvanimschoot3314 4 года назад
@@Techsithtube I think you misunderstood me. I'm looking for your VS Code setup, as in the color scheme and plugins etc. Like your settings.json in VS Code. Cheers!
@gwenaeloppitz3972
@gwenaeloppitz3972 3 года назад
Do you also explain this for typescript? My main struggle is that I find really little tutos for typescript in general and while the advantage it provides is great, it has a lot of pain-in-the ass features for learners
@Techsithtube
@Techsithtube 3 года назад
I would suggest to understand the concept in javaScript and add the types on the top. so that you are not confused with both. Also in typescript there is type any. so just start with javaScript and type any and as you have more requirement, add more types.
@ek4m81
@ek4m81 4 года назад
can you do video on difference between hashrouter and browserrouter?
@ABHISHEKKUMAR-gp8ls
@ABHISHEKKUMAR-gp8ls 4 года назад
sir please make a simple website using react hooks.these things are asking by interviewer now a days.. thanks
@Techsithtube
@Techsithtube 4 года назад
Good to know that that is being asked . I will make tutorial on that.
@rishikumar3076
@rishikumar3076 4 года назад
Please do a video on how to use API on react like there is ways axios Or ajax call which are better.
@Techsithtube
@Techsithtube 4 года назад
Thanks for watching Rishi, I will make a video on AJAX calls.
@aaronbrown3820
@aaronbrown3820 3 года назад
Hi techsith, what is the best way to pass state to child pages, if the state requires http requests?
@vivianeb90
@vivianeb90 2 года назад
Which shortcut did you use here at 5:54 to change all words into "About"?
@prakharmittal6295
@prakharmittal6295 3 года назад
@techsith how to know the last location generated dynamically without passing it as a state prop on all pages?
@quickindiarecipe
@quickindiarecipe 3 года назад
I am having issues with react router e.g. I am loading product data from api in my route /products and I want to keep it even If I change route. e.g. if I go back to /about and then come back to /products route the API call in useEffect should not happen again as it has the same data as previous but it keep on fetching the data everytime I visit the the /product route. Although if I use react-query the issue seems to be solved. I don't know how to overcome that issue. Using localstorage seems to be the solution but react-query doesn't use that still manages to keep the results intact.
@rickyvu2388
@rickyvu2388 4 года назад
I don't understand why you need to use fragment/empty tag at 12:20
@GMERT
@GMERT 2 года назад
Please can you make a video on linking thank you page to emailjs code. I have been having issues with that for more than 3weeks and no video of that nature on youtube.
@prachigarg6641
@prachigarg6641 2 года назад
In WithRouter HOC, how can I get the previous page url? And what will be the previous page URL if I directly hit at my website? How should I handle this edge case?
@ErickG
@ErickG 3 года назад
Does useParams come from react-router or react-router-dom
@kayan_dev
@kayan_dev 3 года назад
replace can change z screen to b screen whithot going back
@karthicks2581
@karthicks2581 4 года назад
Hi Sir, I have a small doubt, In my application in dashboard page or mapview page or any page while hitting refresh button, i need to redirect to login page, how can i handle page refresh functionality and re render my app components App Component:::: ===================
@girishakk3249
@girishakk3249 3 года назад
Sir you didn't explain about Redirect
@tonyxavier3567
@tonyxavier3567 2 года назад
Switch and useHistory are deprecated, I'm looking for the replacement for withRouter
@carter8679
@carter8679 3 года назад
state is undefined when using the useLocation() hook. Anyone else getting this?
@carter8679
@carter8679 3 года назад
yeah, followed the tutorial exactly and state is undefined
@Cloud-577
@Cloud-577 4 года назад
why not use the browser back history ?
@hongkongbboy
@hongkongbboy 4 года назад
@8:36 I got 404 (Not Found) instead of "User peter".
@carter8679
@carter8679 3 года назад
repo for the code?
@tubingforever
@tubingforever Год назад
Ladies and jellmen
@ionitaa
@ionitaa 4 года назад
React router is a JOKE(R)! On one project that started way back (in the V2 days) we use the old history on our redux action creators for async redirects. So I guess we're fucked. WE CAN'T UPGRADE THE ROUTER WITHOUT REWRITING VERY ACTION CREATOR THAT USES HISTORY and every component that now has to pass it down to the action creator itself...
@livingjoke3083
@livingjoke3083 3 года назад
Another stingy programming guide that links no GitHub solution. Sweet
@DopamineMVWM
@DopamineMVWM 4 года назад
go to 7:34 to skip all the nonsense
Далее
React data fetch with suspense  | concurrency mode
19:43
Богатым буду 😂
00:26
Просмотров 585 тыс.
Zoom x100 всего лишь маркетинг
00:41
Просмотров 376 тыс.
Learn useMemo In 10 Minutes
10:42
Просмотров 464 тыс.
React Hook useRef and forwarding refs with forwardRef
14:46
useRef hook in reactjs | Easiest way
19:44
Просмотров 72 тыс.
React Router Tutorial | React For Beginners
33:10
Просмотров 900 тыс.
Learn useRef in 11 Minutes
10:20
Просмотров 618 тыс.
Learn React Router v6 In 45 Minutes
46:20
Просмотров 528 тыс.
React unit testing with Jest & React-testing-library
23:49
Купил этот ваш VR.
37:21
Просмотров 251 тыс.
Bardak ile Projektör Nasıl Yapılır?
0:19
Просмотров 6 млн