Passing Data from Child to Parent Components in React

  Рет қаралды 7,623

KnowledgeKeen

KnowledgeKeen

Күн бұрын

In this video, let's learn how to pass data from child to Parent components.
We will have a look at how the callbacks are supposed to be created and used.
Please support us and subscribe to our channel -
/ knowledgekeen
#reactjs,
#reacttutorial,
#reactjsforbeginners
#passingdata
#knowledgekeen
#knowledge keen

Пікірлер: 32
@BHARATHKUMAR-kp9ig
@BHARATHKUMAR-kp9ig 3 ай бұрын
great
@KnowledgeKeen
@KnowledgeKeen 3 ай бұрын
Thank you Bharat
@SagnikChakraborty-e3q
@SagnikChakraborty-e3q 7 ай бұрын
Thank You Sir!! Was Stuck Hard Since Last 2 hrs And Then Found This Video
@KnowledgeKeen
@KnowledgeKeen 7 ай бұрын
Happy that it helped you 😊
@vishnuprakash8098
@vishnuprakash8098 Жыл бұрын
Explained very well, Thanks
@KnowledgeKeen
@KnowledgeKeen Жыл бұрын
Thank you so much 😊
@blottolotto7648
@blottolotto7648 Жыл бұрын
ur the man. exactly what i was lookin for
@KnowledgeKeen
@KnowledgeKeen Жыл бұрын
Thank you ☺️, I am glad you liked it. Please subscribe and share
@Chopkarmanoj
@Chopkarmanoj 2 жыл бұрын
Great knowledge
@KnowledgeKeen
@KnowledgeKeen 2 жыл бұрын
Thank you @manoj. I am glad you liked it 😊
@Tejaswini-mm1yc
@Tejaswini-mm1yc Жыл бұрын
Thankyou so much for clear explanation..
@KnowledgeKeen
@KnowledgeKeen Жыл бұрын
I am glad @Tejaswini you liked it. ☺️
@midhungk1930
@midhungk1930 2 жыл бұрын
best video .. keep up the good work
@KnowledgeKeen
@KnowledgeKeen 2 жыл бұрын
I am glad you liked it 😊
@snehalgawade-n9u
@snehalgawade-n9u Жыл бұрын
Hello, Thanks for covering this topic. Could you please explain after state lifting how to use that data in the parent component which we have received from child component? (Now we can print that data in the console but how to access that data outside the function?)
@KnowledgeKeen
@KnowledgeKeen Жыл бұрын
Hellozzz, Check this video, this videos does have parent child data passing. kzbin.info/www/bejne/n3TRcqFqar1_bKM And the easiest way to use the values post uplifting is save the same in local usestate variable. And thanks for the comment ☺️
@Human_Only_
@Human_Only_ Жыл бұрын
so useful thanks a lot
@KnowledgeKeen
@KnowledgeKeen Жыл бұрын
Glad it was helpful @Batool ☺️
@mhassankhan8677
@mhassankhan8677 2 жыл бұрын
great tutorial , are you gonna make more videos?
@KnowledgeKeen
@KnowledgeKeen 2 жыл бұрын
Your wish is my command, a video is just uploaded and live 😉
@haiderjaafer8164
@haiderjaafer8164 Жыл бұрын
Great work... Can use this way with react-query
@KnowledgeKeen
@KnowledgeKeen Жыл бұрын
Hey absolutely, react query is quite easy to use with this way too 😉
@MIXKNOWLEDGEbylohith
@MIXKNOWLEDGEbylohith 2 жыл бұрын
I have multiple array of objects (data I use to create multiple charts) in separate js file so now I have to import individual chart data and use that data to create chart in new js file could you please help me or if I am doing anything wrong please correct me.
@KnowledgeKeen
@KnowledgeKeen 2 жыл бұрын
Hi @LOHITH Quite an interesting question. Just have a couple of ideas on top of my head. Basic and most straightforward approach:- Create multiple components and separate JS files with data for each of those components. For e.g If you have a component for the current population with a chart, create files PopulationChartComponent.jsx and PopulationChartData.js respectively. A bit advanced and complex approach:- This would be a bit complex but a more interesting way to do it, would be to create one single component which will render any kind of chart according to the configuration and data we provide dynamically. This way you can save creating an enormous number of components and even any future chart(new requirement) would be easily integrated just by modifying simple configurations. In this too you can have multiple or single data files. Hope this helps 😊 If you like this, kindly help us grow by sharing, subscribing, and hitting those likes
@MIXKNOWLEDGEbylohith
@MIXKNOWLEDGEbylohith 2 жыл бұрын
@@KnowledgeKeen Thanks for the help
@KnowledgeKeen
@KnowledgeKeen 2 жыл бұрын
@@MIXKNOWLEDGEbylohith You are welcome :)
@ssshwanth
@ssshwanth 11 ай бұрын
It is lifting state up
@KnowledgeKeen
@KnowledgeKeen 11 ай бұрын
Thank you for the comment, but I tend to keep it as simple as I can. But yes to those who will read this comment, yes it's also called as Lifting the state 🙂
@shaimeur
@shaimeur 9 ай бұрын
@@KnowledgeKeen lifting the state up is involving moving the state from the child component to the parent component in your example you have used the concept of passing data from child to parent using a call back function and it's not the same think correct me if I made a mistake and thanks for the share!!
@KnowledgeKeen
@KnowledgeKeen 9 ай бұрын
@shaimeur actually it is 😊. The only way to lift the state is using a call back in this case.
@padmamuralikrishna1869
@padmamuralikrishna1869 Жыл бұрын
Can you make a video on passing similar props from parent to grandchild
@KnowledgeKeen
@KnowledgeKeen Жыл бұрын
Hey @padmamuralikrishna1869 , I have shown here how to pass data from Parent to Child ( kzbin.info/www/bejne/fYfOinl8praDqqM ) and passing data from Parent to Grandchild is done in a similar way. For e.g Parent.js const Parent = () => { const counter = 10; return } Child.js const Child = ({counter}) => { return { return Counter in GrandChild - {counter} } This concept is called Prop-Drilling and there are other ways to avoid this, which I will show in our other videos.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 479 М.
React Hooks Crash Course (useMemo, useCallback and more).
31:49
developedbyed
Рет қаралды 85 М.
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 6 МЛН
The selfish The Joker was taught a lesson by Officer Rabbit. #funny #supersiblings
00:12
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 66 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 68 МЛН
Props from Child to Parent Component (Hack)
8:09
Code with Ania Kubów
Рет қаралды 121 М.
ReactJS: 3 Ways Components Passes Data (Complete Tutorial w/ Demo)
8:48
A Software Engineer
Рет қаралды 36 М.
Passing Props From Child to Parent Component in React.js
4:24
TomDoesTech
Рет қаралды 77 М.
React Render Tutorial - 6 - Parent and Child
11:03
Codevolution
Рет қаралды 58 М.
"The Life & Death of htmx" by Alexander Petros at Big Sky Dev Con 2024
23:01
Montana Programmers
Рет қаралды 61 М.
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 6 МЛН