How To Send Data From Child To Parent Component In ReactJS | Lifting The State Up In React |

Sdílet
Vložit
  • čas přidán 14. 01. 2022
  • React Playlist For 2023:
    • React JS 2023
    Hey Everyone,
    In this video I will show you that How to send data from Child to Parent Component in React, which is a concept of Lifting The State Up in React which is We have to handle state in Parent Component
    Please like the video and please subscribe for more tutorials.
    How much JavaScript is Required Before Learning ReactJS?
    • Video
    MERN Stack 2023 Tutorial & Project:
    • Video
    #reactjs
    #reactcomponents
    #reactstate
    Copyright Disclaimer under section 107 of the Copyright Act 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education and research. Fair use is a use permitted by copyright statute that might otherwise be infringing.

Komentáře • 86

  • @McProski
    @McProski Před rokem +4

    Fast and efficient explanation. Thanks a ton - made this concept very easy for me to understand.

  • @robertoriosmorales7528
    @robertoriosmorales7528 Před 2 lety +1

    your tutorial is so good that you actually explained another question i had before i couldnt find googling, awesome

  • @tejassethi9319
    @tejassethi9319 Před 2 lety +2

    This was the best explanation of this concept that I have found on the Internet after 3 hours of Googling. Thank you!

  • @KislayRaj
    @KislayRaj Před 2 lety +1

    Awesome! Thanks for the tutorial!

  • @DavidAdochiti
    @DavidAdochiti Před rokem

    thank you so much! very helpful, I needed this 👍

  • @ahmeterdonmez9195
    @ahmeterdonmez9195 Před rokem +8

    Thanks for your effort dude. But this kind of infos may be misunderstanding for beginners and interview questuon failures! Here is nothing goes from child to parent. You still pass your getData() function from Parent To Child. If your goal is really get data from child, no need extra getData() function and more line codes (DRY Principle). You can create your [name, setName] state in parent and pass them as props to the child and render them in child. Then you will get your info from child. Thanks...

  • @khatariinsaan5284
    @khatariinsaan5284 Před 2 lety +2

    Simple, short and Clear ->> I liked

  • @Photoficaj
    @Photoficaj Před 8 měsíci

    wow! exactly what i was looking, i found it! Many thanks!

  • @shiro298
    @shiro298 Před rokem

    You're a life saver, thank you!

  • @parthumrania6094
    @parthumrania6094 Před 2 lety

    A short & simple explanation, thank you :)

  • @dipikamishra1107
    @dipikamishra1107 Před 2 lety +1

    Awesome tutorial! every min is informative. Thank you very much. “Keep Up The Good Work”!!

  • @2an_sound
    @2an_sound Před 2 lety +6

    While your speed is inspiring, you also somehow explain this SO well, at least for me at my current level. This is a very good tutorial Nikhil!

  • @adolfomolina9919
    @adolfomolina9919 Před 2 lety

    You are the best, thanks so much bro!

  • @alipourhassan3263
    @alipourhassan3263 Před 2 lety

    thank you . this video tutorial helped me a lot

  • @isagive
    @isagive Před rokem

    Awesome, thank u mate.

  • @thunderbolthminfas
    @thunderbolthminfas Před rokem

    Absolutely very simple trick, Thank you so much 😊

  • @matinashrestha7325
    @matinashrestha7325 Před rokem

    Thanks for explaining in a clear and concise manner.

  • @hrishabhkumar1954
    @hrishabhkumar1954 Před 2 lety

    nice one it worked, I was able to achieve the desired result.

  • @viniciusm.m.7822
    @viniciusm.m.7822 Před 2 lety

    Nice!!!
    Thanks, bro. God bless you!
    Forte abraço do Brasil!

  • @akaijoe3582
    @akaijoe3582 Před rokem

    Thank you a lot!

  • @ogs102
    @ogs102 Před 3 měsíci

    that' was
    really helpful

  • @user-dq2zv5zm4n
    @user-dq2zv5zm4n Před 5 měsíci

    Thank you Sir nice video. Helped me a Lot🙏

  • @hirankr
    @hirankr Před rokem

    Much appreciated

  • @hichamaitjak4631
    @hichamaitjak4631 Před rokem

    than you brother you save me from a big problem thanks a big respect for you from morocco

  • @carlospen8413
    @carlospen8413 Před 3 měsíci

    Awesome easy explanation to the point

  • @harshaltamrakar9721
    @harshaltamrakar9721 Před 4 měsíci

    Thankyou! Your tutorial solved a problem.......

  • @thohidbaig405
    @thohidbaig405 Před rokem

    very help full video❤ , and how can we store that value in a constant variable?

  • @thewandererog
    @thewandererog Před 4 měsíci

    Thanks sir 💖

  • @techcube97
    @techcube97 Před rokem

    Thank You Sir❤

  • @gandamraviteja7019
    @gandamraviteja7019 Před měsícem

    very good explanation thank you

  • @agustingiannoni6910
    @agustingiannoni6910 Před 2 lety

    tank u my dear frend!!!!

  • @idk-dr7fo
    @idk-dr7fo Před 11 měsíci

    thank youuuuuuuuuuuu

  • @codeblackfantasy8927
    @codeblackfantasy8927 Před rokem

    Thank you for this, reeeeallly weell done

  • @makuzinus
    @makuzinus Před 11 měsíci

    Большое спасибо индусам с ютуба!!! Я 5 часов боролся с этой проблемой, в итоге нужно было просто пропсы одним элементом прописывать!!!!

  • @hiranyasarma8886
    @hiranyasarma8886 Před rokem

    Nice tutorial

  • @vinothm8631
    @vinothm8631 Před rokem +1

    why are you using state variables again in the child component? can't you use the props directly from the parent

  • @kevinleon4621
    @kevinleon4621 Před rokem

    Thanks papi!

  • @khoanguyentuan417
    @khoanguyentuan417 Před rokem

    thanks

  • @aninexclusive466
    @aninexclusive466 Před rokem

    Nice explanation

  • @ShubhamGupta-zz8wx
    @ShubhamGupta-zz8wx Před 2 lety +2

    Easy to understand with your video

  • @annayeung789
    @annayeung789 Před rokem

    Thanks a lot for the video! Very precise and to-the-point!

  • @Spluli
    @Spluli Před rokem

    eggsaggly what i needed :)

  • @karthikeyanj4952
    @karthikeyanj4952 Před 2 lety

    Good Explanation Nikhil!

  • @MANISHKUMAR-ib3zq
    @MANISHKUMAR-ib3zq Před rokem

    Much fast video, but much clear concept. Aabhaaar🙏🙏

  • @devadharsank7160
    @devadharsank7160 Před 9 měsíci

    This is called as callback function ?

  • @user-wx8lx1hv3w
    @user-wx8lx1hv3w Před rokem

    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 in the Parent Component?)

    • @IndianCoders
      @IndianCoders  Před rokem

      use the state in parent one, and pass both state and setState to child. done😀

    • @user-wx8lx1hv3w
      @user-wx8lx1hv3w Před rokem

      @IndianCoders Thanks! If possible, could you please explain it with an example?
      I would be very grateful to you.

  • @AdilKhan-gj4jy
    @AdilKhan-gj4jy Před rokem

    Very clear but please explain in more details because we some are beginners

  • @rutvijbagde633
    @rutvijbagde633 Před 10 měsíci +1

    You are techinfoyt 😮

  • @atifreza4607
    @atifreza4607 Před rokem

    i bought ur mui styled course from udemy

  • @kunalsingh9461
    @kunalsingh9461 Před rokem

    super and sample

  • @hi-yi7en
    @hi-yi7en Před 2 lety

    simple but effective best answer to give in interviews..tq

  • @hrishikeshthite6674
    @hrishikeshthite6674 Před 2 lety +1

    Can you tell me how to print the that getdata not on the console but on the screen like in paragraph

    • @IndianCoders
      @IndianCoders  Před 2 lety

      It's super simple, Store data from getdata in state variable. Update the state when receiving that data. Then you can render on screen.

    • @nickolas240
      @nickolas240 Před rokem

      @@IndianCoders thanks a lot

  • @ankurgangwar4923
    @ankurgangwar4923 Před rokem

    bhai y dusro ko samghane k liye bnai thi ya khud ka revision chl rha tha.

  • @HarpreetSingh-br2ix
    @HarpreetSingh-br2ix Před 2 lety

    how do you pass multiple input fileds from child to parent without using state in child?

    • @santiagodelrivero
      @santiagodelrivero Před rokem

      You could use state in the parent and then pass the entire state as props to the child. Doing so, you could set the state in the child and it will automatically change the state in the parent

  • @madelsonacosta7962
    @madelsonacosta7962 Před 2 lety

    Thank you for this clear explanation, I appreciate it. Would you mind explaining what's a parent and a child in react, please? I don't seem to grasp it.

    • @IndianCoders
      @IndianCoders  Před 2 lety +1

      Parents are those components who render child components. Like the List component loops through an array and renders each ListItem (child) component inside it.

    • @madelsonacosta7962
      @madelsonacosta7962 Před 2 lety

      @@IndianCoders Thank you so much!

    • @haider_javaid
      @haider_javaid Před rokem

      @@madelsonacosta7962 You will understand much better if the parent and child component is in a different file.

  • @lmanqhrmanova8006
    @lmanqhrmanova8006 Před 3 měsíci

    But I have 3 differences between my parent and child elements, in this case personally, this way shouldn't work, how i can achieve this, I already have used a lot of ways but I can't already I feel extausted😢

  • @souvikkumarpaul4282
    @souvikkumarpaul4282 Před 2 lety +1

    how to store the data in mysql database via nodejs

  • @sampathb2920
    @sampathb2920 Před rokem

    its good and supper but go little slow , beginner also watching ,we are expecting like this only

  • @ashutoshjha5522
    @ashutoshjha5522 Před rokem

    Is it lifting state up ? Passing data from child to parent?we can do it with use imperative handle too please highlight if anyone can m confused
    Moreover here prop is passing from parents to child

  • @ahmedlazrak1884
    @ahmedlazrak1884 Před rokem

    wa 3la ghm9a

  • @CatchyVideo
    @CatchyVideo Před rokem +1

    Bro , here again u passed props from parent to child only ..how come it's concept called child to parent ..

    • @IndianCoders
      @IndianCoders  Před rokem +1

      Yes we added callback in child, so when child component fires something so we will get that in parent component.

  • @gabrielgavrilov520
    @gabrielgavrilov520 Před měsícem

    "How To Send Data From Child To Parent Component"
    >proceeds to show how to map a function from a parent to a child
    thanks for wasting my time

  • @k4f
    @k4f Před 2 lety +24

    This was the best explanation of this concept that I have found on the Internet after 3 hours of Googling. Thank you!

    • @IndianCoders
      @IndianCoders  Před 2 lety +1

      Welcome 😄

    • @yuvrajgaonkhowa5520
      @yuvrajgaonkhowa5520 Před rokem +1

      Totally Agreed. I looked so many exammples and finally got it right because of this.

    • @bhaskar99
      @bhaskar99 Před 11 měsíci

      Same, last night same thing happened with me

    • @rajureddy5865
      @rajureddy5865 Před měsícem +1

      I forgot everything after I listened these video

  • @venkatchalam6385
    @venkatchalam6385 Před rokem

    Nice explanation