ReactJS Tutorial - 37 - Render Props (Part 2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 พ.ย. 2024

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

  • @auss6328
    @auss6328 5 ปีที่แล้ว +34

    I really like how you slowly built up the need for Render Props and slowly built up the solution. The very real-world iterative approach is extremely helpful. Thank you! :)

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

    after browsing in the internet for hours and searching for a good tutorial and found this tutorial, this channel gonna build my future

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

    One of the best explanation for render props available on internet.

  • @davidkezi6086
    @davidkezi6086 5 ปีที่แล้ว +102

    This has to be the best explanation of render props i have seen and now i finally understand it. Thank you very much

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

      I agree

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

      you get this because you have watched the same topic in other places many times or at least once,
      but I'm just starting out man! I don't get this at once!!!!!!!!!
      But,no offence to Vishwas though, I think I just need to watch this again!

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

      @@siemen_subbaiah watch the part 1...
      instead of passing a value, you pass a function, the function allows you to return anything you like. This makes the Counter component serve more than one purpose.

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

      @Mustafa Shaikh hi

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

      first i read official documentation and but i didn't understand very well , but after watch this video everything became clear to me

  • @princepoornadoddi4682
    @princepoornadoddi4682 2 หลายเดือนก่อน

    the quality of react you teach is 🔥 . mind blowing explanation dear .

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

    You are a champion!
    You took an intimidating and scary complicated subject and turned it into a piece of cake for me!

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

    For me, it helps to think of it as as:
    - Higher order components start with the content to render, then add extra functionality to it.
    - Render props starts by defining an instance of the common code, then you can decide what to render within it.

  • @muhammadarish6796
    @muhammadarish6796 5 หลายเดือนก่อน

    This is the best ever react series by someone. Loving your content friend!!!

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

    Thank you sir! Very simple explanation, step-by-step and no rush. Highly appreciated!

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

    whole series is an excellent job, I learn every concept one by one from multiple people after sweating and spending so much time, but Bishwash do that every thing in single playlist all together even more with very simple and easy way.
    . Well explanation
    . Easy to grape and
    . Excellent and expert tutor
    Thanks a lot.

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

    I kind of understand Render Props now but at the same time feel that it would easily cause confusion if implemented in a project.

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

    Hands down the best explanation of Render Props. Keep up the good work.

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

    The baby step approach that you use to teach is awesome, man!! Your channel is too good!

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

    One of the best-simple-easy explanations..

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

    I love the cliffhangers!!! Keeps me going

  • @muhammadhassan9162
    @muhammadhassan9162 9 หลายเดือนก่อน

    Really this example clear all the concepts releated to this.

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

    This guy is a genius holyyyyy SMokes

  • @HarshalHirve555
    @HarshalHirve555 5 ปีที่แล้ว +12

    Hello Sir,
    Thank you so much for this series. Its very useful & the way you have explained in simple language is really commendable. A request, can you please expalin memo, lazy & context api from React 16.6.0

  • @matserpiece
    @matserpiece 5 ปีที่แล้ว +2

    you are like code art designer. Thank you soooo much!. you make code fun to work with!

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

    Explained in a very easy and simple way.

  • @Aman-Verma
    @Aman-Verma 4 ปีที่แล้ว +13

    render props, HOC, context Api all try to achieve the same thing but what's the difference among them and when tho use what?

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

      Never going to implement using such complex concepts.

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

      @@jineshnadar6409 Basically when you want to share some of the complex code between different components, and you don't want to use too much of higher order components.
      As it can get confusing, if one sees component using two three HOC's.
      Render props is a solution.
      And many libraries use this to provide a lot of functionality as well.
      Eg: Formik, React-Virtualized, React-window, React-beutiful-dnd and many more.
      And certainly it has many use cases.

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

    brooo i was itching to comment "top tier explaining" while still watching the vid

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

    this finally helped me understand the formik render props

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

    Does render props and HOC serve the same purpose. can you use either of them @codevolution

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

    How somebody can give him a thumb down to this man, good job my friend, god bless you for share your knowledge

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

    Summary explains it all ❤️ Thanks

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

    In what instance can we use the render props in a project ?

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

    very nice explanation, Specially the baby steps. (simply wow) 👍

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

    Tough topic but Great Explanation !!!

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

    Clear explanation. Thanks for your hard work.

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

    Hi Vishwas, How do we send parameters in render Props from other components, let say in this example how can we make the counter dynamic sending it from ClickCounterTwo or HoverCounterTwo

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

    Amazing tutorials for a beginner ..

  • @MuhammadAhmed-wb2sq
    @MuhammadAhmed-wb2sq 2 ปีที่แล้ว

    Thanks for those videos. Really helpful

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

    Perfect explanation :-) thank you Sir

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

    Superbly explained

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

    Nice episode! I liked you provided keep it simple stupid examples (which is not simple to do!) and also a great business context

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

    Very nice explanation 😂. Subscribed pap

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

    Great explanation, style and example

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

    Very clear 🎉

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

    Brilliantly explained! 👌

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

    it's similar to the parent-child components you thought us earlier but this time we are passing a function down to the child component. right?

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

    Well explained , i like most the way of tiny steps may god bless you :)

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

    Very helpful tutorials. Thank you

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

    people like elon musk,bill gates, steve jobs and vishwas are born rarely in world.thank u

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

    Who said react is for beginners 😢😮 its simple yet complex

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

    Hello Sir,
    HOC and Render props techniques are used to solve the same problem in different ways.
    which way is more feasible in what type of situation? Thank you..

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

      Would like to know that aswell

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

      Sinse you asked this question 5 months ago. What did you find out? It would be greatly appreacited if you answer.

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

      @@freshenup6195 Sinse you asked this question 11 months ago. What did you find out? It would be greatly appreacited if you answer.

    • @ИванВзводнов
      @ИванВзводнов 3 ปีที่แล้ว

      @@arazmammadov9276 Sinse you asked this question 1 months ago. What did you find out? It would be greatly appreacited if you answer.

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

      @@ИванВзводнов Sinse you asked this question 1 month ago. What did you find out? It would be greatly appreacited if you answer.

  • @fanzzzzzzzzzzzzzzzzz
    @fanzzzzzzzzzzzzzzzzz 5 หลายเดือนก่อน

    Why are methods passed from Counter component within DIV tag ? What happens if we remove DIV tag and how is DIV tag returned by counter component handled in App component?

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

    So confused, why are you using duplicate name?

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

    Wow awesome video! You are really great in explaining coding, congrats. But can I have a parameter with the increment count value in render props like HOC?

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

    Can someone please explain 7:22 count1st={count2nd}
    What is difference between count1st and count2nd ?

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

    Very Helpful Video

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

    Nice Explanation

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

    ..also please let me know which plugin have you used to display that file path (bread-crum) ?

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

      I would assume he's using "BreadCrumb In Status Bar" by Daniel Daniels. . .It's the only option I see for breadcrumbs, Harhsal.

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

    thankyou for the clear explanation

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

    Amazing, Thanks man

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

    awesome tutorial.

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

    If there are multiple children in a component. Then how can they know about which props is to pass whom.

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

    2:22 next step

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

    hello sir this video is not solving issue i have complete your all code then finally click and hower function did not run
    when i made click and hower function seperate it will run then when i combine it it will not run plz check this issues

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

    3:47 render() can be over-written??

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

    Nice explaining.

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

    Amazing video, thank you so much!!

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

    How is render (as a prop) is not overriding the render lifecycle method? I didn't get this.

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

      As its the Prop.Why would a prop name override a lifecycle method anyway

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

    I'm new to React so I was just wondering, if we need to share functionality why don't we just use inheritance?

    • @brockross818
      @brockross818 5 ปีที่แล้ว +7

      If the components who need to share code have a direct parent-child relationship, inheritance can be a great way to share. However, especially as an app grows in size and complexity, the components which need to share code may be very distant from each other in the 'family tree.' In that case, inheritance would become very cumbersome, requiring logic to be passed through several unrelated components. Render props (as well as Higher Order Components) allow us to avoid this long chain of inheritance-passing. More recently, React has added the Hooks feature, which eliminates the need for render props and HOCs altogether.

    • @paolo-1283
      @paolo-1283 4 ปีที่แล้ว +1

      @@brockross818 Hi can you elaborate how Hooks eliminate render props and hocs altogether? let's say you have an app that has and add and remove buttons to create an array of counter components to which each has its own state and methods (increment and decrement). Now you have 2 states to manage, first is the state of the array of counters and second is the state of individual counter component. You still need render props or hocs to add count, incrementCount and decrementCount to plane component.

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

    it is not working i am using his own code but it is still not working ;(

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

    Thank god
    We should thank React Hooks for this complex kind of code sharing😅😅

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

    Mind blowing 😮

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

    output is not rendering. idk why.
    there are some issues i think so

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

    How to pass additional count to Counter like you did in HOC

  • @HemantKumar-yk2jk
    @HemantKumar-yk2jk 5 ปีที่แล้ว

    excellent explanation.

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

    Thank you.

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

    Can you please make a video with ReactJs (Ecomerce project)

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

    very nice explination

  • @NewHorizon-v9p
    @NewHorizon-v9p 3 ปีที่แล้ว +4

    WARNING.. First of all Thanks for this tutorial to help people out , But like every tutorial there is always pros and cons , just let me explain to you first why we should stop at cons and start discuss to work around to solve our cons . Simply because it could occurs misunderstanding for beginners which will lead them to memorize instead of understanding.. in this particular tutorial there a lot of cons unfortunately.. but I will talk about only one thing .. that is your Counter.js file there the main idea is to implement a logic not to build a piece of UI.. so 1- No need to import React library just import { Component } 2- No need in render native method to return { this.props.render(this.state.count, this.increamentCount) } .. why and why and why you are wrapping it ??? this could lead beginners to strongly misunderstanding again you are not implementing UI.
    return this.props.render(this.state.count, this.increamentCount) that's quiet enough I am writing the whole class just to pass data to somewhere else . it seems something small and its small but very important. other cons are related to time and space complexity ( high level Co ) like Google, Amazon or Facebook could comment it if they see developers doing it, I will not discuss them unless someone in the comment ask me! Thanks again

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

      I'm asking, please tell the whole thing 🥺

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

    Thank you for the great video, I have a doubt... How can I set different initial state (count, incrementNumber) values for ClickCounterTwo and HoverCounterTwo ? I have a similar scenario where my initial states are greatly dependant on the initial api call.
    Thanks in advance.

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

      Can anyone else answer this question please !

    • @LogeshSLohit
      @LogeshSLohit 5 ปีที่แล้ว +8

      @@chethannp5981 Hi you can pass one more prop as initial value so that it can set the value when the component got mounted;
      For ex:
      in Counter.js file
      setInitialValue = (initValue) => {
      console.log("setting Initial value: " + initValue)
      this.setState({ counter: initValue })
      }
      ButtonCounter.js
      componentWillMount() {
      this.props.setInitialValue(this.props.intialValue)
      }
      and call with,

      ()} />

  • @ahmedal-ebrashy3691
    @ahmedal-ebrashy3691 3 ปีที่แล้ว

    Thank you, God bless

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

    nice explanation,

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

    Goat

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

    awesome

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

    10:15 two simple changes

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

    Thaaaaaaaak Yoooooooou Soooo Much.

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

    4:11 Definition of Render Props

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

    Kinda confusing topic...

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

    8:38 Summary

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

    9:55 prop need not be written as render

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

    little but over the head

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

    Save the children

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

    what is a Vishwas?!

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

      its name

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

      @@atulsingh6624 he's name , not it's name

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

      Vishwas is the instructor's name and it means "Trust".

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

      @@AlffreyGeorge That is cool! Thanks!

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

      Name of the instructor.

  • @franciscogallardo9499
    @franciscogallardo9499 5 ปีที่แล้ว +2

    01:15 I used simple quotes, doble quotes doesn't works

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

    HOCs far better than render props 😊

    • @Vasanth-lo1dx
      @Vasanth-lo1dx ปีที่แล้ว

      Correct, As I don't know Class comps 😊

  • @Bybt-q7x
    @Bybt-q7x 5 ปีที่แล้ว +6

    wow, render props suck

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

      HOC is way better and easier to follow IMO.

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

    i think hoc is better

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

    Vishwas hai is me kuch khaas hai

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

    u didn't cover routing most basic and important topic in ur tutorial for reactjs...

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

    Thank you sir! Very simple explanation, step-by-step and no rush. Highly appreciated!

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

    6:50 next step

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

    3:16 next step

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

    4:44 next step

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

    4:55 next step