React Router in Depth #7 - Route Parameters

  Рет қаралды 38,852

Net Ninja

Net Ninja

Күн бұрын

⭐⭐ Watch the whole course now (without ads) on Net Ninja Pro:
netninja.dev/p...
🐱‍💻 Access the course files on GitHub:
github.com/iam...
🐱‍💻 React Tutorial:
On Net Ninja Pro - netninja.dev/p...
On KZbin - • Full React Tutorial #1...
🐱‍💻 React Router Docs - reactrouter.co...
🐱‍💻 VS Code - code.visualstu...

Пікірлер: 59
@maskman4821
@maskman4821 Жыл бұрын
One thing very important Shaun forgot to mention is that there is naming convention in loader function, for example, if the route name is Career, the loader function name has be careerLoader() in camel case.
@Simon-wi7vr
@Simon-wi7vr Жыл бұрын
Thank you! Does this mean each component can only have one loader? What if you want to load multiple data types into a single component?
@omoleyeosadare5775
@omoleyeosadare5775 7 ай бұрын
@@Simon-wi7vr it is stated in the react-router doc that each component to it own loader function
@andromilk2634
@andromilk2634 5 ай бұрын
So it would not work if the convention is not respected? Or it's just a question of style? Thanks
@iLoveToLearn247
@iLoveToLearn247 Жыл бұрын
Always saving lives with your great way of teaching. Thanks Shaun
@rockbelleh6237
@rockbelleh6237 Жыл бұрын
Wow..my mentor i miss ur teaching tnks alot for this. U r gifted 😍😍😍
@NetNinja
@NetNinja Жыл бұрын
It's my pleasure
@kholaseerat2385
@kholaseerat2385 Ай бұрын
Great and easy explanation. To the point love it thanku so much
@NetNinja
@NetNinja Ай бұрын
Most welcome 😊 thanks for watching!
@darkooo94
@darkooo94 Жыл бұрын
If I understand correctly, we actually don't need useParams hook in the CareerDetails function after we setup the loader and get the variables through useLoaderData hook, right?
@hybs9473
@hybs9473 Жыл бұрын
Question, why there's not a need to map the career that was fetched on the careerDetails.jsx?
@chinmayghule8272
@chinmayghule8272 Жыл бұрын
@@hybs9473 The response only had a single person object.
@ichiroutakashima4503
@ichiroutakashima4503 Жыл бұрын
@@hybs9473 exactly as what chin said. Basically, you selected an item, and that item is one object. Apart from the original list which is an array of objects.
@reneehani434
@reneehani434 Жыл бұрын
same question and I deleted and still works fine ...
@Ahmed-fq3kz
@Ahmed-fq3kz 10 ай бұрын
Yes, useParams and useLoaderData works dependently
@ivan4486
@ivan4486 10 ай бұрын
Great course! Thank you! I wonder how to show a preloader while data is being fetched.
@bipulkushwaha1567
@bipulkushwaha1567 4 ай бұрын
Next Level, Just Great.
@NetNinja
@NetNinja 4 ай бұрын
Awesome, thanks! :)
@ahmedserifoski5999
@ahmedserifoski5999 Жыл бұрын
you are THEE MAN !!!!!!!! 🔥🔥🔥
@NetNinja
@NetNinja Жыл бұрын
Thanks Ahmed!
@souviknag
@souviknag 10 ай бұрын
You just saved the day! Thanks a ton. Liked and subscribed
@NetNinja
@NetNinja 10 ай бұрын
Glad it helped :) thanks for subscribing!
@souviknag
@souviknag 10 ай бұрын
@@NetNinja Since you have replied, do you have any course on UDemy or any other platform? Where I can learn more may be?
@sabril.m8248
@sabril.m8248 11 ай бұрын
thank u man im very greatful with this tuto
@stefanmasic1287
@stefanmasic1287 Жыл бұрын
Hi. I used instead of "id" different field name (numofpage or stevilkastrani in our language). Nothing works. Then I change model in db.json (field name) and also fields in .js (App, CareerDetail). And YES, everything works. You stated that we can use any parameter name (for example "abc"), but just don't work. About video: GREAT! Best regards, Štefan.
@jacobhagan553
@jacobhagan553 Жыл бұрын
Please values are missing in careerDetails component when i select a career item. Could you please help?
@ALotThx
@ALotThx 7 ай бұрын
Thanks for this great video!
@NetNinja
@NetNinja 7 ай бұрын
Thanks for watching! :)
@arazhamid
@arazhamid 11 ай бұрын
I appreciate it 👏,so Why does it give an error when I use career.name instead of career.id?
@qiuzhi99
@qiuzhi99 Жыл бұрын
using antd pro?
@LonBorey
@LonBorey Жыл бұрын
How do we use JSON-server when we deploy the project to the hosting server?
@arjunrajeev469
@arjunrajeev469 Жыл бұрын
I believe json-server is only used to mimic a real-world REST API which returns a JSON response. In reality, you will substitute the localhost:4000 URL with your API endpoint URL.
@philippe4368
@philippe4368 11 ай бұрын
How I can pass the entire object as parameter, instead only ID? That way I would not need to fetch API again if I have already the data.
@omoleyeosadare5775
@omoleyeosadare5775 7 ай бұрын
Read the react-router docs. your are suppose to give each component it's own loader function
@catalinbanici3357
@catalinbanici3357 Жыл бұрын
Can I get a single object from an array of objects without fetch and loader functions?
@ajaykumbhar6919
@ajaykumbhar6919 3 ай бұрын
Use fetch and loader function in the parent component and pass each object as a prop in the desired component
@benyamin4634
@benyamin4634 Жыл бұрын
awesome thanks
@Ahmed-fq3kz
@Ahmed-fq3kz 10 ай бұрын
Awesome
@michalnowak2181
@michalnowak2181 Жыл бұрын
thx
@Sameh_ElGazar
@Sameh_ElGazar Жыл бұрын
can someone explain the careerDetailsLoader func (passing the params obj to it) 05:00
@omoleyeosadare5775
@omoleyeosadare5775 7 ай бұрын
This ":id" is called dynamic url. careerDetailsLoader it helps us in loading data into a component before it render unlike useEffect(). in this case to associate each career to it's dynamic url, we need to call params object as an argument to the careerDetailsLoader so that when we go to a certain path=":id" on or browser we would get the corresponding career.
@mohamedyoussef8835
@mohamedyoussef8835 Жыл бұрын
Awesome video +++++++++++ 😀
@xanny9849
@xanny9849 Жыл бұрын
when will be next lessons uploaded?
@NetNinja
@NetNinja Жыл бұрын
I'll be uploading again daily from Boxing day (26th) :).
@elvisadesese2842
@elvisadesese2842 10 ай бұрын
I need a career change to get career change. That is why I am following this channel
@NetNinja
@NetNinja 10 ай бұрын
Awesome, welcome aboard and best of luck on your journey Elvis! :)
@yourSOULismy
@yourSOULismy Жыл бұрын
Why you added toString() for career.id in the Link? It works without this. I checked in console.log and it return just a number without convert. It matter in url that you use string id than number id? in CareersDetails you left id with useParams but it's not used in this file. Is it required for something?
@chinmayghule8272
@chinmayghule8272 Жыл бұрын
JavaScript coerces types implicitly. If a string is being concatenated to a number, then the number will be implicitly coerced into a string and then both the strings will be concatenated.
@ichiroutakashima4503
@ichiroutakashima4503 Жыл бұрын
Unless you're using typescript. Link's "to" property actually needs to read a string, hence conversion is needed.
@orangeblossom9968
@orangeblossom9968 Жыл бұрын
but doesn't interpolation make its content a string automatically?
@cartermah5165
@cartermah5165 Жыл бұрын
Following through this tutorial now and am not getting the right element in the array from the API? Eg: Going to careers/3 ends up showing me the 4th career in the array instead of the 3rd career- which is the one that has id 3. Any ideas?
@josegkurszewski8363
@josegkurszewski8363 Жыл бұрын
Wow, you are the man!! This course is what I needed to fully understand React Router DOM. Perfectly explained. Thank you very much. I really appreciate the time you put into creating these videos. Thanks for sharing this valuable content. 😊
@marianaangel5338
@marianaangel5338 Жыл бұрын
I am the first to watch it!
@GethushanRavichandran
@GethushanRavichandran Жыл бұрын
Please create a Playlist about "Creating E-Commerce Website using Strapi , MongoDB, React , and Stripe"
@marianaangel5338
@marianaangel5338 Жыл бұрын
Could you please make us a playlist of Nextjs integrated with Redux?
@muhammadfahad9330
@muhammadfahad9330 Жыл бұрын
sir I love the way You teach i just wanted To ask That i Am currently Learning Flutter From your youtube channel. First i have to learn Flutter For Beginners playlist and than Flutter with Firebase Right? These 2 Playlists are enough To learn Flutter? kindly Ans I have texted You on Instagaram as well but u didn’t respond ? waiting Kindly tell me the roadmap of Learning Flutter
@maskman4821
@maskman4821 Жыл бұрын
You can learn it from chatGPT, It is good especially in coding and programming, just ask any question and you will get the desired answers you need and want 😘
React Router in Depth #8 - Error Elements
9:03
Net Ninja
Рет қаралды 27 М.
React Router in Depth #6 - Loaders
12:07
Net Ninja
Рет қаралды 58 М.
Man Mocks Wife's Exercise Routine, Faces Embarrassment at Work #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 5 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 99 МЛН
Brawl Stars Edit😈📕
00:15
Kan Andrey
Рет қаралды 56 МЛН
iPhone or Chocolate??
00:16
Hungry FAM
Рет қаралды 39 МЛН
Learn React Router v6 In 45 Minutes
46:20
Web Dev Simplified
Рет қаралды 559 М.
React Router in Depth #10 - Forms & Actions
11:17
Net Ninja
Рет қаралды 34 М.
Laravel vs Rails for Javascript developers
19:50
Sam Lewis
Рет қаралды 2,5 М.
10 React Antipatterns to Avoid - Code This, Not That!
8:55
Fireship
Рет қаралды 749 М.
You might not need useEffect() ...
21:45
Academind
Рет қаралды 161 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
All useEffect Mistakes Every Junior React Developer Makes
22:23
React router crash course
55:54
Hitesh Choudhary
Рет қаралды 38 М.
Man Mocks Wife's Exercise Routine, Faces Embarrassment at Work #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 5 МЛН