For anyone who didnt get the error message (kinda ironic that we want to get an error message), my best bet is that react handles that by it self on newer versions. I still followed along with the rest of the video and had no problems so I'd advice you to not stress about that and keep enjoying the tutorial
@feliciaf8 Жыл бұрын
ooo that's why i didn't get it
@mihajlocolic01 Жыл бұрын
I just thought of googling if that's covered in newer versions. Thanks for letting us know.
@frontend3409 Жыл бұрын
I assumed that's because i've used v6 (still followed along with the videos), but looks like it's not. thanks
@berzolka Жыл бұрын
Thanks for the info. It was a bit confusing. that I didn't get the error.
@izleogrenkodla Жыл бұрын
It is not new v6 react-router, it is newer version React. So you will not get an error since React will automagically handle it.
@waynetasaki2 жыл бұрын
To everyone who didn't have an abort error but then when creating the cleanup function you got an error each time the page loads - REMOVE both React.StrictMode tags that wrap your component in your index.js file. I believe since strict mode is enabled, certain functions are fired twice and that's what causes the error to load even when you're not doing anything to truly abort the fetch. If you want, you can just leave the strict mode tags and understand that in production, you would not receive the Abort Error and nothing is inherently wrong with your code. I hope this helps others who were stuck trying to understand why the hell the Abort Error kept popping up. 😀
@youssefmokhtar10582 жыл бұрын
I didn't get an error in the first place, is that because I'm using version 6 of react router instead of 5?
@sahajatantra2 жыл бұрын
Thanks so much. I was wondering about this. And i was already wondering for quite a while why certain functions are always fired twice - now i finally know.
@therameez922 жыл бұрын
Thank you, your comment answered my questions.
@frubas41272 жыл бұрын
I was about to go mad because of this :)). Looked for an answer on this on the internet for a while now. Thank you so much. You just saved me minutes if not hours of just browsing the web
@alaasayed6508 Жыл бұрын
thanks for ur comment , it really helped me
@kristofferjohansson37683 жыл бұрын
And all of a sudden I coded all 24 episodes. This is more addictive than Game of Thrones once was! I need more :)
@raymondmichael49873 жыл бұрын
He has a way of ending an episode which make you wish for more.
@ericmomoh79272 жыл бұрын
Exactly and is way enjoyable.
@reenasoni39382 жыл бұрын
hahaha
@soumadip_banerjee2 жыл бұрын
Kudos ❣️😊
@jeeadvanced12302 жыл бұрын
Yes ❤❤❤❤❤❤❤
@jasper50162 жыл бұрын
I cannot believe that I started this series, finished 24 episodes and coded them as well. Thanks a lot for being an awesome teacher.
@Hacking-NASSA-with-HTML2 жыл бұрын
Hi! Did you make it in a single day 🤔?
@SergeiFedorov772 жыл бұрын
These tutorials are great! Many years ago I watched your vue/vuetify tutorials and I've been using those at work since then with great success! Now I'm aiming at learning react which is not too hard after knowing vue. Two notes: I'm on react v18.2.0 and react-router-dom v6.4.3 and using React.StrictMode makes the "useEffect" run twice. Furthermore the routing seems to be "exact" by default now and switching routes while the fetch of data still is in progress does not seem to cause an error.
@Hacking-NASSA-with-HTML2 жыл бұрын
exactly 👍 and react-router-dom is v6.6.1 Everything Changes quickly😁
@newesttechdesigninnovation8121 Жыл бұрын
Im in a coding bootcamp called nucamp and your videos help me more than them. Omg your the only coding youtuber i understand trust.
@mustafasaitkonuk3519 Жыл бұрын
I am confused. I don't get an error like you said but i don't get console message "fetch aborted". IDK what i have done wrong :D
@feliciaf8 Жыл бұрын
same it doesn't cause even if i don't use clean up
@Pupu._4 жыл бұрын
best, best, best teacher ever
@NetNinja4 жыл бұрын
Thank you!
@mkmalikcom4 жыл бұрын
ya, right 👍
@MasterMathematicswithMatthias Жыл бұрын
It's like telling an interesting story. I cannot stop wachting it. I put this whole weekend on this.
@DragonwingZify2 жыл бұрын
In the documentation about the React.StrictMode if anyone is using version 6. They introduces a new development-only check to Strict Mode. This new check will automatically unmount and remount every component, whenever a component mounts for the first time, restoring the previous state on the second mount. Basically from what I've read is, they are saying we don't have to use the useEffect Cleanup because the React.StrictMode is handling the function for us. If anyone has an idea of why we should still use the AbortController I would like to know.
@wheeler5532 жыл бұрын
Yeah idk, I removed Strict mode and I'm still not getting any error in the console and everything is working fine
@leonardomalave25692 жыл бұрын
@@wheeler553 same as you but im using 5.3.4 version, but are u getting functions fire twice on console?
@wheeler5532 жыл бұрын
@@leonardomalave2569 yes
@art1co2 жыл бұрын
@@leonardomalave2569 me too, i dont have the error and i'm having the function twice in th console, if i cut the switch mode, i don't have the print out twice anymore, but still no error for the unmount if i don't have the clean up, annyway, great tut anyway
@astik2002 Жыл бұрын
so all in all, if Im using v6 of react dom I don't need to use useEffect Cleanup??
@LiteBusigt4 жыл бұрын
Thank you for these videos. You are honestly the best teacher on KZbin I have found. I watched your Flutter&Firebase series and loved that too, thank you!
@whereislolly3 жыл бұрын
This is the most beneficial channel on KZbin. Thank you so much, Shaun.
@afxcrush413 жыл бұрын
This is the most understandable and precise tutorial series of all youtube
@vikash-kumar-gupta3 жыл бұрын
While learning React on this tutorial here, I did also learn about cancelling any API call before component tear-off. Thank you for making other related concepts clear through your videos. This learning can be utilized in any framework while doing fetch and cleanup.
@nikhildhakal37272 жыл бұрын
Didn't get the mentioned error but seems its better to add this in case of slow servers. Worked smoothly.
@Troglodyte20219 ай бұрын
I tried setTimeout to 3 seconds, still no error. I guess I will simple skip this video and move on to the next. :)
@Corolley3 жыл бұрын
Mr Net Ninja, I normally don't post a comment under any KZbin video but I just want to thank you for your video's. You've got a talent for clearly explaining the syntax and logic of React and React-based frameworks. Without your help, I'd still be tasting in the dark. Keep it up, and I will foward your video's to my fellow colleagues, they'll for sure love them too!
@saida5843 жыл бұрын
Thank you, Master. You charged my day with the extra mile with tuts. As always you are the best. Thank you very much for this cleanup video
@TheBobby29083 жыл бұрын
this channel is a goldmine.
@DebugWithAdam2 жыл бұрын
I just revised myself in less than 48 hours, great content
@michaeleyitayo3 жыл бұрын
Omo. Thanks so much for explaining clean up like this. This is the best I've seen so far
@raymondmichael49873 жыл бұрын
I can finally cross this off the list, cleanup was such a big pain in my head. I had to visit this series hoping you can help, it was a perfect guess. Thanks dude, happy break.
@andrewperez78443 жыл бұрын
Wow easily the best explanation on this topic! I feel like this was overlooked by people when they teach useEffect. Would have never known about the about signal. Thank you!
@hm.8211 Жыл бұрын
this is so addictive. great tutorial!
@moisen87734 жыл бұрын
Hi Shaun, is it normal that I am not getting any error?, like you had. Even before I add the cleanup function, everything seems to be working correctly. When I write the return function in useFetch, and console.log('fetch aborted'), I can see the log in the console. But when I add the if/else statement in the catch err function, and return ()=> abortCont.abort(), I am not receiving any log, and no error, every thing still work... 🤔. Sorry but when I am not seeing any error, and all still works, that's weird and suspicious 🤨. I must be missing something.
@alexander55823 жыл бұрын
If remove artificial setTimeout func -> there won't be any err-s at all (had the same question)
@moisen87733 жыл бұрын
@@alexander5582 Thanks, for the info.
@chrisandrew86463 жыл бұрын
I have the same problem... or actually... lack of problem. I am wondering why I am not getting the error that should be generated by jumping between the buttons at the 0:32 mark... thanks
@bidishapal43392 жыл бұрын
Stuck in that exact same point. Not getting any error. Also, when I write cleanup in console, while switching b/w pages, it comes like - Cleanup Cleanup Cleanup While the message in the video comes like - Cleanup (1) Cleanup (2) Cleanup (3) No clue where I went wrong!
@voice_famous_books43012 жыл бұрын
I asked the same question above. So I'm hoping someone to answer that:)
@webdev47863 жыл бұрын
you are my best teacher... one day I might meet you in person and thank you for all you have done.
@nanayawfreduah3 жыл бұрын
Thank You Very Much For The Precise Yet Indepth Explanation
@IvanBankovic-k6n Жыл бұрын
If it aborts the fetch why it does not abort it immediately but only after you click on another page?
@boyiscola2 жыл бұрын
If the cleanup message is not working as in the video, comment out React.StrictMode in index.js.
@tichaa2 жыл бұрын
This was quite helpful to me
@omeatai2 жыл бұрын
Thanks a bunch! I was looking out for the solution.
@andromilk26349 ай бұрын
By curiosity, why is it that you keep talking about state of the Home component even though we have moved the state instead to a hook? Isn't the state the exclusive property of the hook now, and we're just receiving the data from it to our component? (Which happens to be unmounted by the time the fetch has finished) Or am I not understanding?
@wheeler5532 жыл бұрын
I'm not getting the error you're displaying, I'm using async/await instead of promise chaining and I have the setTimeout on as well, but everything is working fine no errors thrown.
@neoz225 Жыл бұрын
U don't need cleanup anymore for react router v6, it's handled by itself using the new routing method i.e component routing
@BearIsAwesome97 Жыл бұрын
The best tutorial on react
@Dexter101x3 жыл бұрын
With your accent, I thought y you meant something else at 2:55 🤣
@JesusSanchez-cd3ze3 жыл бұрын
Lmao
@petarp39383 жыл бұрын
Lol right, i came down to see if someone else already commented on it. "ye fookin cont" i bet he says.
@tomasburian6550 Жыл бұрын
Good job, Mr. Ninja, learned a lot!
@elgizhasanzada2 жыл бұрын
This annoying warning finally solvedd damnnn. Thanks so much
@shadebinder3599 Жыл бұрын
i dont get the error you get from switching pages quickly, does this have to do with something about how from react 18 it automatically mounts and mounts or something when you first load? I always get two usefetch messages bec of that
@geometrydashjowinator1936 Жыл бұрын
Who would have thought that not getting an error would be a bad thing lol. i didnt got it either, my guess is that newer versions of react handle that for us
@Unknown_22-z8c Жыл бұрын
Does v6 react router dom automatically handles abort controller, because it seems i'm not getting any warning messages even with commenting react.strictmode?
@destroyerajdev Жыл бұрын
I think it does so, I've been trying to get the error but it hasn't popped up
@rexrider4916 Жыл бұрын
i also think it does i cannot get the error
@ebadrahman183210 ай бұрын
best tutorial in the web ❤
@NetNinja10 ай бұрын
Wow, thanks! :) hope it was helpful
@voice_famous_books43012 жыл бұрын
Hello and thanks The Net Ninja:) My code doesn't show an error about fetch even when I don't use 'AbortController'. Why? My React version is 18.1.0 and RRD version is 5.3.3 . Is it relevant to my versions?
@avatr71093 жыл бұрын
HOLLLY FOCCK this is the 24th Lesson i dont know how much time I Sat . This is so well Taught....its addictive 🤪🤪🤪
@icetmzz90742 жыл бұрын
im using v6 and not getting this error. Why's that?
@yogyyconst2 жыл бұрын
because you using v6
@jeffgoes41163 жыл бұрын
Thank you for an amazing explanation!! I have a question You showed us how to use the signal parameter in a fetch method but what if we used other http client like axios?
@saidakhmedagitaev3 жыл бұрын
Thanks for the series, Shaun. Is there any chance to show us how to use less common hooks (useMemo, useRef etc.) as well, as a part of the series?
@NetNinja3 жыл бұрын
Hey, those two hooks are not in this series, but I will be making some more one-off videos about lesser-used hooks at some point in the future.
@khushikavya2555 Жыл бұрын
can anyone help with "Failed to fetch" error ?
@himalayagupta77443 жыл бұрын
You are one of a kind. Excellent Teaching
@israeldearaujo942 жыл бұрын
I used async await instead of then and I did not use setTimeout. It worked well and I didn't see the error showed in this video. And I tried a lot of times.
@wheeler5532 жыл бұрын
me neither...
@yoooc252 жыл бұрын
thank for this best toturial, one question, when i'm clicking the home or the New Blog link in the navbar i see the browser change to correct link but the page not changed. only if i'm clicking "enter" on browser to link that changed i'm getting the right page.. Someone help?
@David-fy1sn3 жыл бұрын
Is there a possible link to know or understand why or when the abort signal is fired off?
@VoxyDev3 жыл бұрын
lol udemy instructors are shaking if u continue to keep your work as greate as this :)
@AtitManandhar Жыл бұрын
Thank you for this knowledgable content. Really appreciate it.
@jamesmalarkey74373 жыл бұрын
Tight, Tight, Tight. React, Vue, Angular doesn't matter just keep teaching me it.
@majdkhasib763 жыл бұрын
I thought that I am good in React until I saw your AMAZING videos! I will recommend them for my firends as well! Thank you so Much sir!
@MustafaMohamad-nd9bw Жыл бұрын
Great tutorial, thank you. is it possible for the home component to be unmounted right after the fetch but before all the states finish updating. If so, I guess we would have to handle this case.
@chrisandrew86463 жыл бұрын
I'm not able to replicate the error message that should be generated by quickly clicking between the "Home" and "New Blog" buttons... I've tried setting my network speed to simulate a slow 3g connection... I've also tried increasing the time of the setTimeout function. Can anyone advise what is a possible way to simulate the error message. My code is exactly spot on in line with the tutorial... perhaps some Chrome setting? idk... 8) thanks. These tutorials are excellent. What a wonderful instructor and teacher.
@chrisandrew86463 жыл бұрын
Hello, I thought I'd share what was causing me not to see the error message as it appeared in the video. I noticed that I actually wasn't ever reaching the Create.js component, and it was down to having left out the "exact" part before the Route path attribute in the App.js file... doubtful that anyone will be having the same issue due to the same oversight, but the moral is to check your code... check, check and then double check. And thanks again to the NetNinja for these amazing tutorials. Thanks
@RadeonVector2 жыл бұрын
I still get the "Warning: Can't perform a React state update on an unmounted component. " error, anyone figured out what's up?
@shashankpandey19663 жыл бұрын
short and to the point ...Thanx a lot.
@emiliomaalouf51012 жыл бұрын
I wasn't getting the error before when I was switching really fast between pages and also, when I was using the console.log thing to display a message it was doing it whenever I switch. Now that I'm using this it keeps giving me fetch aborted whenever I load the home page and after i get the data. Anybody knows why ?
@lomeinmaster2 жыл бұрын
I'm having the same issue. Did you find a solution?
@lrajoo113 жыл бұрын
thanks for adding this - just got this error :)
@BackyardniJuan2 жыл бұрын
im not getting that can't perform error in class component "react": "^18.2.0",
@mj27582 жыл бұрын
SAME
@rehanayoub45743 жыл бұрын
Please also create a tutorial for testing for both react and nodejs and how to mock db calls and api. I want to learn integration testing and unit testing using any javascript testing framework
@Abogida113 жыл бұрын
When I switch from one link to another I don't have that error message in my console...as Net Nonja has it.what's going on?
@_swordancer_3 жыл бұрын
Shaun I have just found Your video on Brad Traversy channel, I have looked through it and it is next on my list after this react tutorial :)
@saketaryan22273 жыл бұрын
Awesome videos...love from INDIA
@akshaypendyala3 жыл бұрын
Hey Shaun i got this warning when I used abort. src\useFetch.js Line 37:6: React Hook useEffect has a missing dependency: 'abortCont'. Either include it or remove the dependency array react-hooks/exhaustive-deps can you explain what this is.
@Tschüss1015 ай бұрын
I need HEEEEELP... I can't get the error😂 I want to GET it. Isn't that weird??
@SAIEN3334 ай бұрын
same with me, maybe this is fixed in new updates?
@ercanyanmaz56242 жыл бұрын
Excellent Teaching, Thank You.
@ArlyJuDe1st3 жыл бұрын
Can someone help me, I always get an error it say "error 'AbortController' is not defined no-undef"
@wolfie1001 Жыл бұрын
for those that get this and cant find the answer, as someone said below, it needs to be, new window.AbortController(); rather than just, new AbortController();
@azyjmexcuseokstop92428 күн бұрын
I'm using router version 7 and I did not get any errors when quickly switching back and forth from home to create. Do you think they implemented a feature so that people dont need to clean up their code with router version 7 ?
@samirprasla17703 жыл бұрын
i am wating on next video !! one again thank you for your hard work !!
@pawcio171353 жыл бұрын
This guy is so damn good, i love u mate u're helping me and my friends a lot. Best React tutorial i've ever seen (it's m y first xDD)
@GAGANDEEPSINGH-jx4ky3 жыл бұрын
@thenetninja how do you know that is the point where we ve to write console.log("cleanup") and it ll show when we switch to New Blog ?? Please explain
@sarvarkhalimov1113 жыл бұрын
Thank you, man. Great tutorial!
@MrVipulLal3 жыл бұрын
Useful series. Thanks
@AndresVargas-nv8vh2 жыл бұрын
For this chapter after 02/2022 if you have still the issue update: err.name === 'Abort Error' to err.name === 'AbortError'. Example: (you can test it with the console.log) .catch(err => { // console.log(err.name); if (err.name === 'AbortError') { console.log('fetch aborted'); } else { setIsPending(false); setData(null); setError(err.message); } } Note: the setData(null); inside the .catch() is because that removes the All Blogs! information when we receive an error.
@itgiants52183 жыл бұрын
Woow I have learned a lot of things, thank you so much
@jess1403 жыл бұрын
Great tutorial, you explained things so well!
@work99093 жыл бұрын
May I know the logic behind why the clean up function is in the return statement? Why it wouldn't clean up everytime when we useEffect? or actually I does abort everytime just we are not catching that, in that case will that err carry onto the next useEffect?
@dylanroberts62173 жыл бұрын
If you're still getting the error, make sure to remove the setTimeout.
@bskull32323 жыл бұрын
No offense, but I don't know if you are being sarcastic or serious. The idea he added the timeout is to simulate a real world Internet scenario. Without the delay sure you will get around without any cleanups, but when you deploy it, it will go wrong.
@nicholassmith64122 жыл бұрын
Excellent video. Very helpful, thank you
@ThirisulaVarahi2 жыл бұрын
All right then
@oussamaamireche11842 жыл бұрын
Thank you so much for this amazing playlist 🤩. i just wanna ask a question which is why I'm not getting that error like you do? is it because I am using a new version of react?
@b2elias3 жыл бұрын
Awesome information my friend, thank you!
@erkanisuf36043 жыл бұрын
This shit right here is GODLIKE , thanks man !
@chethananderson34463 жыл бұрын
Loved it🔥
@abbisalmi19483 жыл бұрын
Wicked lesson! thank you!
@EJ-jh1vf3 жыл бұрын
*gets slag pregnant* Slag: what should we do? Me: 3:53
@ms77grz3 жыл бұрын
Now I know how 🙂 Thanks Master!
@rakeshchauhan-op8qw3 жыл бұрын
2:56 - most famous english words.
@nasrinsolati31753 жыл бұрын
What if we do not get the warning, do we still need to write the abort code?
@sunilanthony17 Жыл бұрын
I have a bit of a problem, everything works but I'm still reaching the abort error message when I load the Blogs.
@kazuoy3 жыл бұрын
Thank you very much to show me such a great contents!!
@bskull32323 жыл бұрын
Thanks for your video. Have been learning MERN for a while and stumbled on your video, and I must say I love the style. I'm an old dog learning new tricks -- have been coding in VB since the early 2000s, and since early 2010s doing embedded works. Keep up with the good works! However I do have a doubt -- this fetch abort mechanism might have a problem in extreme cases. If the page change happens between the fetch has completed, while the JSON parser is doing its job, there will not be anything to catch this case, and we will still have the error. Granted, this is a very low chance event as the JSON parser on a modern computer takes microseconds to return, but still with large enough data and many enough users, this can happen. I think a better way is to add a lock variable on the return function, which gates all state updates.
@Chris-yx4gn3 жыл бұрын
Curious here, how would you gate the state updates?
@lskills213 Жыл бұрын
I just wish that I know about the net ninja tutorial at my graduation time...
@heytheremogwai2 жыл бұрын
do you have to associate abortController with a specific action? can you just have one in the useEffect itself, declared and then return () => abortController.abort()?
@paularosler9493 жыл бұрын
Hi! Thank you so much for this tutorial, it is really great!
@thejesudayan77862 жыл бұрын
Hi Ninja, I followed the same code but my page is not fetching the data from json and is neither responding to page change via url or click. /create is doing nothing
@thejesudayan77862 жыл бұрын
please help
@rajchinagundi74983 жыл бұрын
I got stuck here ,theres a lot going on and i havent had any problems with this tutorial till yet, but am i the only one who feels like this
@PaardekooperJoris2 жыл бұрын
If you're here not getting the error mesage: check your navbar file. I apparently missed the code for vid23 and didn't get the error.
where should we place this {signal : abortCont.signal} thing if we are using lazy loading import method instead of fetch, I tried to place it inside setstate and it worked, is this the right way to do it or we should do it in a different way. I did it like const importlang= async (code) => { const lang= await import( `../../languages/${code}/test.json` ); setState(lang, { signal: abortCont.signal }); };
@PatrickPereiraVieira042 жыл бұрын
Hi there, I've finished the whole project to the end but I seem to still have an issue with this step. Even when I have the same code I still get something strange. From console.log(err.message), the console says "Failed to execute 'fetch' on 'Window': The user aborted a request." but that's just from refreshing the page.
@jsanchez51992 жыл бұрын
Had the same experience, I just started learning react yesterday, what I did was remove strict mode from the render, and this error was gone, I'm guessing it has something to do with the app rendering twice on strict mode, but I really don't know why.