ReactJS Tutorial - 15 - Methods as props

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ย. 2024
  • 📘 Courses - learn.codevolu...
    💖 Support UPI - support.codevo...
    💖 Support PayPal - www.paypal.me/...
    💾 Github - github.com/gop...
    📱 Follow Codevolution
    + Twitter - / codevolutionweb
    + Facebook - / codevolutionweb
    📫 Business - codevolution.business@gmail.com
    In this video, we take a look at passing methods as props in React components

ความคิดเห็น • 168

  • @ruijadom
    @ruijadom 4 ปีที่แล้ว +82

    Vishwas you are very good teachen. With knowledge, good to communicate and very structured. undoubtedly a channel to follow! Congratulations

    • @kingberz
      @kingberz 4 ปีที่แล้ว +3

      Absolutely!

  • @talha8o
    @talha8o 4 ปีที่แล้ว +89

    I used to think Mosh was the best, but i think your approach suits me better.

    • @kingberz
      @kingberz 4 ปีที่แล้ว +32

      mosh skips a lot of things for paid courses

    • @ginnerzapata5909
      @ginnerzapata5909 3 ปีที่แล้ว

      Mosh is amazing and this man too

    • @DauntingGecko
      @DauntingGecko 3 ปีที่แล้ว +10

      Agreed. Mosh is pretty shockingly poor, constantly skipping essential parts rushing to get stuff done rather than teaching. He also has paid content that is out of date and his code is buggy. Mosh was too busy showing off, refactoring (improving) code all the time rather than teaching

    • @het314
      @het314 3 ปีที่แล้ว +2

      Soo true. I wasted a lot of time watching his videos.

    • @shashankpandey1966
      @shashankpandey1966 3 ปีที่แล้ว

      @@het314 same ..sed lyf..

  • @juhandvan
    @juhandvan 5 ปีที่แล้ว +37

    The best React Tutorial on the internet very easy to understand Thanks!!!

  • @RincyMathew-xl6fm
    @RincyMathew-xl6fm 5 หลายเดือนก่อน +6

    After going the first few tutorials - i know your first name :) - I wanted to say Vishwas that these are the best best tutorial i have come across - so very well structiured and very well explained - i have a long way to go in this playlist - but wanted to say thank you (million times) for compiling this well structured & well laid out playlist - thanks again!

    • @dikshaa262
      @dikshaa262 3 หลายเดือนก่อน

      hey can we follow this playlist in 2024?

    • @stillhet1986
      @stillhet1986 3 หลายเดือนก่อน

      @@dikshaa262 still viable in 2024

  • @Immortal-pu8gr
    @Immortal-pu8gr 3 ปีที่แล้ว +1

    Tried learning with random videos they don't tell u these minute details, this is the best anyone will ever get.

  • @amanryzus
    @amanryzus 3 ปีที่แล้ว +4

    man, I can't I just can't stress enough how concise and simple ur guide is.
    what I spent days struggling and learning, was cleared in a matter of minutes.
    you are subscribed !!

  • @lukescheller7216
    @lukescheller7216 4 ปีที่แล้ว +4

    Probably THE BEST coding tutorial series I've ever studied.. THANK YOU.

  • @PragnaPresence
    @PragnaPresence 2 ปีที่แล้ว +10

    Addicted to this playlist. Best content on React on YT. Complex topics well explained in a very simpler way.

  • @bolanhost
    @bolanhost 5 ปีที่แล้ว +4

    Man, You are The best, Awesome, Amazing. It has been many years I am learning from TH-cam, different courses. but your Teaching Power is awesome, you are explaining in the best way. Thank you so much

  • @nandanithakur2172
    @nandanithakur2172 4 ปีที่แล้ว +16

    following your playlist, these are very easy to understand and helpful too. the way you explain the concept is awesome.
    requesting you to create series on react native too.

  • @4647540
    @4647540 4 ปีที่แล้ว +3

    I can't imagine understanding this complex topic by my own... Thanks man

  • @amolmali3583
    @amolmali3583 3 ปีที่แล้ว +2

    Great explanation I ever seen for child to parent communication. Thanks Vishwas.

  • @khadijaaitbouiramouin7776
    @khadijaaitbouiramouin7776 5 ปีที่แล้ว +19

    Great work sir, Please add videos related to React & Redux approach. Thanks a lot for your efforts that's something that we really appreciate.

  • @ramcharanmadasu7052
    @ramcharanmadasu7052 5 ปีที่แล้ว +1

    Actually I followed your angular tutorials since angular 2 bt., My boss requirement is react then I decided to learn react on that day... I saw you posted your first react video.... Thanks a lot sir... You helped me a lot... 😍😍😍

  • @StanielBG
    @StanielBG 4 ปีที่แล้ว +2

    function comment() {
    return "The best React Tutorial on the internet!" + " " + "Very well explained in detail tutorial!" + " " + "More or less 'React for Dummies' ";
    }
    comment();

  • @marvinfok65
    @marvinfok65 2 ปีที่แล้ว

    Vishwas, you have some of the best React lessons that I can find! Your lessons were very well organised with clear explanations and great examples!

  • @arminsmajlagic2907
    @arminsmajlagic2907 4 ปีที่แล้ว

    Thank you for these 76 videos, there is enough to get a good grasp of what is react...Thanks man !
    !

  • @olegsubik
    @olegsubik 5 ปีที่แล้ว +3

    So well explained such an important theme! Easy to understand! thanks man

  • @toannew
    @toannew 3 ปีที่แล้ว +3

    2:15 template literal of ES6
    6:20 the arrow function is the simplest way to pass parameters from the child component to the parent component

  • @henrywang4361
    @henrywang4361 2 ปีที่แล้ว

    The best tutorial and one of the most useful methods in web development!

  • @metizdev7945
    @metizdev7945 2 ปีที่แล้ว

    Awesome concept clearance of props pass methods and access methods in child component

  • @snehalpatil6691
    @snehalpatil6691 15 วันที่ผ่านมา

    This is best react video i have ever seen

  • @arunchauhan79
    @arunchauhan79 4 ปีที่แล้ว

    I like your way to teaching, i understand all the concept you are to explain. Thank you a lot for your efforts.

  • @arbazajaz2473
    @arbazajaz2473 4 ปีที่แล้ว +1

    EVERYTIME I LEARN SOMETHING NEW, I PRESS LIKE!

  • @jagdishshetty4782
    @jagdishshetty4782 5 ปีที่แล้ว +1

    All tutorials Very Well Explained !!! Thx so much !!!

  • @TomarSahabVlogs
    @TomarSahabVlogs 5 ปีที่แล้ว +3

    The 4th approach i.e using arrow functions is the best for binding the events

    • @MichaelRainabbaRichardson
      @MichaelRainabbaRichardson 5 ปีที่แล้ว

      The previous video covered this and I was just about to ask why he did not use an arrow function for greetParent 🤔

    • @ginnerzapata5909
      @ginnerzapata5909 3 ปีที่แล้ว

      @@MichaelRainabbaRichardson I think it is because he said at the start of the series he wanted us to get used to this and its perks. So maybe he is just teaching us through repetition about binding in the state and stuff.

  • @arios0312
    @arios0312 5 ปีที่แล้ว +1

    Amazing tutorial, best i have seen so far

  • @ginnerzapata5909
    @ginnerzapata5909 3 ปีที่แล้ว

    your course is so good... The Odin project brought me here

  • @alasobhan6941
    @alasobhan6941 3 ปีที่แล้ว +2

    AMAZING TUTORIALS! YOU SHOULD MAKE MORE VIDEOS.

  • @raisasadiq7957
    @raisasadiq7957 3 ปีที่แล้ว

    Best explanation in very simple way

  • @motor_matic
    @motor_matic ปีที่แล้ว

    bro you just solved my problem, I was very confused with this but now its clear , thanks a lot bro for your awsome videos
    🙌

  • @myseccode
    @myseccode 4 ปีที่แล้ว +1

    Best Tutorial. Thank you for making these

  • @aresstest9860
    @aresstest9860 5 ปีที่แล้ว +4

    Sir great I am waiting your next react js video.. Please add video related react .. As soon as possible

  • @mohamedreejan8143
    @mohamedreejan8143 4 ปีที่แล้ว +1

    Very useful tutorial. Great explanation . thanks you very much.

  • @vvmanikantakantipudi9919
    @vvmanikantakantipudi9919 2 ปีที่แล้ว +1

    At 5.33 in childcomponent props used that is not workingout with me it's results error at the browser can u help me to fix this

  • @tomek2841
    @tomek2841 4 ปีที่แล้ว +1

    Great work! Full free course for beginner in react, like me. Thanks :)

  • @huanshao2165
    @huanshao2165 4 ปีที่แล้ว +1

    Awesome! I am a huge fun of you now

  • @MangSentot
    @MangSentot 4 ปีที่แล้ว +1

    Best tutorial than udemy courses !

  • @shloch2007
    @shloch2007 4 ปีที่แล้ว +1

    very good at explaining .... you are great

  • @sreea1504
    @sreea1504 5 ปีที่แล้ว +1

    Great work easy to understand
    Great work

  • @westworld4553
    @westworld4553 ปีที่แล้ว

    this is just perfect content on react

  • @abrarfahim64
    @abrarfahim64 ปีที่แล้ว

    Gopinav u are a gem

  • @holong583
    @holong583 4 ปีที่แล้ว +2

    you saved me, thanks so much

  • @akashsrivastava8226
    @akashsrivastava8226 4 ปีที่แล้ว +1

    your work really appreciated, thanks a lot

  • @arpansaha7369
    @arpansaha7369 ปีที่แล้ว

    Great information videos, just a request for using functional components instead of child one as it is used more

  • @piyushkumar-me1nb
    @piyushkumar-me1nb 4 หลายเดือนก่อน

    As a Python developer, I should upgrade myself in React JS or pyspark?

  • @lathagm666
    @lathagm666 10 หลายเดือนก่อน

    completed video 15. Thanks 🙂

  • @MrEuugen
    @MrEuugen 4 ปีที่แล้ว +1

    excellent tutorial..

  • @sudippoudel1840
    @sudippoudel1840 4 ปีที่แล้ว +1

    Can we use bind in place of arrow function? If so, why ?

  • @AmmuMizAymuAlu
    @AmmuMizAymuAlu 2 ปีที่แล้ว +1

    import React from 'react'
    function ChildComponent (props) {
    return (
    props.greetHandler()}>Greet Parent
    )
    }
    export default ChildComponent

  • @issaissifou3579
    @issaissifou3579 4 ปีที่แล้ว +1

    Great work!

  • @nahassan2000
    @nahassan2000 ปีที่แล้ว

    Thank you Sir!

  • @prakashmohaldar9004
    @prakashmohaldar9004 2 ปีที่แล้ว

    If we would have defined childcomponent as a class component then do we have to bind props.greetHandler too in childcomponent ?

  • @richardli7020
    @richardli7020 4 ปีที่แล้ว +1

    Does this only work when the parent component is a class? Cuz I tried to use a functional component as the parent and it didn't work

  • @ajaybatham3622
    @ajaybatham3622 4 ปีที่แล้ว +1

    Great Sir...

  • @vignesh3by4
    @vignesh3by4 4 ปีที่แล้ว +1

    Hi Codevlotion, Can u please tell what theme and font are u using to enable font ligatures. it will be very useful

    • @editorera239
      @editorera239 4 ปีที่แล้ว

      were you asking for this ES7 React/Redux/GraphQL/React-Native snippets
      extension

  • @PujaKumari-ie9kj
    @PujaKumari-ie9kj 3 ปีที่แล้ว

    I have a question, if we have a button and onclick setstate changes the flag var to true and we want to display set of data from state using map, how to achieve this ? I'm able to display using map without the flag condition but with condition , I'm unable to . {this.state.flag ? (
    {events.map(event => (event.EventName))
    }

    ): null}
    would something like this work ? As its not working. :(

  • @rabinawale5224
    @rabinawale5224 2 ปีที่แล้ว

    do we still need to bind this keyword on constructor if we are using number 2 way( fat arrow)?

  • @vaibsify
    @vaibsify 2 ปีที่แล้ว

    awesome explanation 🙏

  • @Heisenberg28954
    @Heisenberg28954 4 ปีที่แล้ว +1

    For me No comments for your fabulous Vedios

  • @arunskaria7646
    @arunskaria7646 3 ปีที่แล้ว

    Doubt:just after creating a class component, why are we deleting the export keyword? (it occures in between 0:50-0:55 in video)
    Meanwhile the tutorial is very good and easy to understand

    • @praiseoshilim1006
      @praiseoshilim1006 2 ปีที่แล้ว

      He deleted the export keyword because we don't want named export. We want a default export.
      Basically, when we want to import 'ParentComponent' in say app.js, you do this:
      Default = 'import ParentComponent from './Component/ParentComponent' . Rather than Named = 'import { ParentComponent } from './Component/ParentComponent'
      I hope I was able to clear your doubt. Thanks

  • @siddheshingalkar9300
    @siddheshingalkar9300 ปีที่แล้ว

    @Codeevolution its showing me an error for the above example, can you tell me where have you defined in ChildClass the function property 'Child' to ParentClass childName. The childName is declared but its value is never assigned.
    The error while executing the code is "Hello Parent from undefined."

  • @youtuberjonyo6094
    @youtuberjonyo6094 2 ปีที่แล้ว

    why can I not use parent component method at any other html element except button click event inside child component?

  • @Aditya.Santra
    @Aditya.Santra 3 ปีที่แล้ว

    Very Helpful Video

  • @yznyzn8939
    @yznyzn8939 7 หลายเดือนก่อน

    professional thanks a lot

  • @neokristar
    @neokristar ปีที่แล้ว

    The greet parent button is not visible, I have written ParentComponent and childComponent properly and included the parentComponent in app.js, but still it is not visible

  • @sabajaved9821
    @sabajaved9821 4 ปีที่แล้ว +1

    The code is giving me Error: "props.clickHandler is not a function" and not displaying the alert dialog box.

    • @hashmatali4409
      @hashmatali4409 4 ปีที่แล้ว +2

      see if you bind this function into the constructor

  • @kunalsakhare7538
    @kunalsakhare7538 3 ปีที่แล้ว

    why is line 12 needed in ParentComponent.js? What happens if greetParent was an arrow function, then line 12 would be still needed?

  • @jakehuang4697
    @jakehuang4697 4 ปีที่แล้ว

    Hi sir. I would like to ask which react snippet did you in the video. Can you let me know when you get a chance? T

  • @DeepakSingh-sy4ws
    @DeepakSingh-sy4ws 4 ปีที่แล้ว

    You are too good man.

  • @san29sh
    @san29sh 4 ปีที่แล้ว

    the way of explaining is too good.

  • @tmahesh3607
    @tmahesh3607 3 ปีที่แล้ว

    8:09 i know the concept of desctructuring !but for this example can you tell me how to desctructure ? i have tried is it correct?
    childComponent.js
    import react from 'react'
    function childComponent(greetHandler)
    {
    return( greetHandler('child')}>greet parent )
    }

  • @munishgupta7878
    @munishgupta7878 4 ปีที่แล้ว

    I tried doing it without using the constructor and bind keyword. Code is something like this:
    class ParentComponent extends Component{
    state={
    message:'Greetings'}
    greetParent(){
    alert(`hello ${this.state.message}`);
    render(){
    return(
    Getting an error message: TypeError: Cannot read property 'state' of undefined.
    Any idea what am I missing?
    Got the solution. Just make the greetParent an arrow function.

  • @aravind_venkatachalam
    @aravind_venkatachalam 3 ปีที่แล้ว +1

    Nanbargale Vanakam

  • @kamesha5973
    @kamesha5973 3 ปีที่แล้ว

    Shall we inherit properties from childcomponent to parentcomponent,Sir?

  • @manyaaaa2607
    @manyaaaa2607 ปีที่แล้ว

    Can you make video on "methods as props using functional component"

  • @lesterlugtu4090
    @lesterlugtu4090 4 ปีที่แล้ว

    Did i get it right? that upon clicking the button in the Child, it doesn't "set another state" in the Parent? It just alerted the parentName out? These are all just passing property from Parent to Child and parameter from Child to Parent? or mali ako? :)

  • @lakki_rock1651
    @lakki_rock1651 4 ปีที่แล้ว

    Sir, when I am applying ES6 feature for alert.. It was not getting output.

  • @Kidsadan
    @Kidsadan 4 ปีที่แล้ว

    one correction in ParentComponent :
    Use function like below to avoid greetParent function not found error:
    greetParent = (childName)=>{
    alert(`Hello ${this.state.parentName} greetings from ${childName}`)
    }

  • @sravanigundepalli3513
    @sravanigundepalli3513 ปีที่แล้ว

    What are the parent and child components here? Can someone please help me understand this

  • @AhamedKabeer-wn1jb
    @AhamedKabeer-wn1jb 4 ปีที่แล้ว

    Thank you Sir..

  • @rajuu_ra
    @rajuu_ra 4 ปีที่แล้ว

    Hey hi, your videos are very useful to me.
    I have doubt in this video.
    How to access child component methods from parent component.
    Please help me.
    Waiting for your valuable reply.
    Thanks

    • @yadnyeshrane8498
      @yadnyeshrane8498 3 ปีที่แล้ว

      I think this your problem can be solved with ref

  • @valikonen
    @valikonen 4 ปีที่แล้ว

    This is the only way you can transmit data from a child component to a parent component in react?

  • @codewithsub5083
    @codewithsub5083 3 ปีที่แล้ว +1

    This doesn't work in non creat-react-app. Getting this is undefined in parent component.

  • @moderncloth682
    @moderncloth682 3 ปีที่แล้ว

    I love you, Vishwaz.

  • @zakaryalaarrague
    @zakaryalaarrague 8 หลายเดือนก่อน

    thanks

  • @husseinabdullahi1822
    @husseinabdullahi1822 3 ปีที่แล้ว

    Hello
    someone to guide on how i can install react snippets
    i will really appreciate
    thank you Vishwas for this great tutorial

  • @geragamo
    @geragamo 2 ปีที่แล้ว

    Please post the extension used for snippets, and good video

  • @prasadreddy7181
    @prasadreddy7181 4 ปีที่แล้ว

    Is it correct passing parameters from child component to parent component. ? I heard that the data should pass from parent to child.

    • @MuhammadUsman-rp3ph
      @MuhammadUsman-rp3ph 4 ปีที่แล้ว

      i think it mimics the concept of inheritance from object oriented programming like in c# and java.. so if it is so then cant pass data from child to parent

  • @pranavkanekar277
    @pranavkanekar277 4 หลายเดือนก่อน

    best ever

  • @jakubgadzala7474
    @jakubgadzala7474 3 ปีที่แล้ว

    Legend!

  • @vikk1249
    @vikk1249 3 ปีที่แล้ว

    is it also called as state lifting sir?

  • @ramsinassyrian7904
    @ramsinassyrian7904 3 ปีที่แล้ว

    legend

  • @codeblooded6760
    @codeblooded6760 4 ปีที่แล้ว

    How to pass data from child to parent without onClick method?

  • @modestmoron
    @modestmoron 3 ปีที่แล้ว

    Why we are using arrow function to pass parameters? Why can't we just use props.greetHandler('child'). I know we can't use this but why?

    • @sumanpokharel1718
      @sumanpokharel1718 3 ปีที่แล้ว

      because by doing this we are calling back the greetHandler function where we were supposed to run the function.if you want to do this you have to write it inside a arrow function as it automatically binds this keyword.

  • @prisinha
    @prisinha 2 ปีที่แล้ว

    4:20 use method as value of attribute

  • @prisinha
    @prisinha 2 ปีที่แล้ว

    5:15 pass prop from child component

  • @aribkamal3239
    @aribkamal3239 2 ปีที่แล้ว

    I still cant figure out how passing in childName will equate to child in the child component

    • @aribkamal3239
      @aribkamal3239 2 ปีที่แล้ว +1

      WAIT nvm I got it. beautiful.

    • @Vsumit17OG
      @Vsumit17OG 2 ปีที่แล้ว +1

      from rendering

  • @nikhilkajota114
    @nikhilkajota114 2 ปีที่แล้ว

    my UI is showing 2 buttons?

  • @AAKSHAS
    @AAKSHAS 2 ปีที่แล้ว

    6:06 how to pass a parameter when calling parent method from child component