Developer Way
Developer Way
  • Видео 16
  • Просмотров 229 367
Making sense of Higher Order Components - Advanced React course, Episode 7
👉 Based on the "Advanced React" book, Chapter 7: www.advanced-react.com
🎬 Episode 7: Higher Order Components in the modern world
00:30 What's in the episode
01:01 What is a Higher Order Component
01:42 Injecting props with HOCs
02:26 Enhancing callbacks with HOCs
05:44 Enhancing lifecycle methods
06:06 Intercepting DOM events
👩🏻‍💻 Code examples:
1. Injecting props (theming): www.advanced-react.com/examples/07/01
2. Button with logging on click: www.advanced-react.com/examples/07/02
3. Passing data to HOC: www.advanced-react.com/examples/07/03
4. Logging on mount: www.advanced-react.com/examples/07/04
💬 Twitter: adevnadia
💬 Linkedin: www.linkedin.com/in/adevnadia/
Просмотров: 8 025

Видео

Mastering React Reconciliation - Advanced React course, Episode 6
Просмотров 13 тыс.10 месяцев назад
👉 Based on the "Advanced React" book, Chapter 6: www.advanced-react.com 🎬 Episode 6: Deep dive into diffing and reconciliation in React 00:34 What's in the course 01:31 The problem we're going to solve 03:24 React reconciliation & diffing - mounting 05:45 React reconciliation & state update 08:37 Why we can't create components inside other components 09:48 The answer to the mystery 11:18 Reconc...
Mastering memoization in React - Advanced React course, Episode 5
Просмотров 17 тыс.11 месяцев назад
👉 Based on the "Advanced React" book, Chapter 5: www.advanced-react.com The fifth episode of the "Advanced React" course. The course will be uploaded episode by episode once every 1-2 weeks. 🎬 Episode 5: Memoization with useMemo, useCallback and React.memo 01:22 Intro to memoization and its purpose in React 03:33 How useMemo and useCallback hooks work - React API 04:55 How useMemo and useCallba...
Render props - Advanced React course, Episode 4
Просмотров 13 тыс.Год назад
👉 Based on the "Advanced React" book, Chapter 4: www.advanced-react.com The fourth episode of the "Advanced React" course. The course will be uploaded episode by episode once every 1-2 weeks. 🎬 Episode 4: Advanced configuration with render props 00:51 Intro to render props 3:26 Sharing state through children as render props 4:40 How hooks come into play 5:54 When render props can still be usefu...
Components as props - Advanced React course, Episode 3
Просмотров 14 тыс.Год назад
👉 Based on the "Advanced React" book, chapter 3: www.advanced-react.com The third episode of the "Advanced React" course. The course will be uploaded episode by episode once every 1-2 weeks. 🎬 Episode 3: Elements as props 00:00 The problem 00:47 Generic components with elements as props 2:54 Elements as props - downside 3:42 Default props to elements as props 4:25 Downside of default props 4:57...
Elements, Children and Re-renders - Advanced React course, Episode 2
Просмотров 21 тыс.Год назад
👉 Based on the "Advanced React" book, Chapter 2: www.advanced-react.com The second episode of the "Advanced React" course. The course will be uploaded episode by episode once every 1-2 weeks. 🎬 Episode 2: Elements, Children and Re-renders 00:00 The problem 00:59 Composition trick to reduce re-renders 3:11 What are the Elements 4:42 How rendering and re-rendering are triggered 5:29 Diffing and r...
Intro to re-renders - Advanced React Course, Episode1
Просмотров 45 тыс.Год назад
👉 Based on the "Advanced React" book, Chapter 1: www.advanced-react.com The first episode of the "Advanced React" course. The course will be uploaded episode by episode once every 1-2 weeks. 🎬 Episode 1: Intro to re-renders 00:00 The problem 1:41 React lifecycle basics 3:37 Danger of custom hooks 4:53 The big re-renders myth 5:52 Moving state down 👩🏻‍💻 Code examples: 1. The problem: codesandbox...
Fantastic closures and how to find them in React
Просмотров 12 тыс.Год назад
👉 Advanced React Book: www.advanced-react.com 👉 Fantastic closures and how to find them in React: www.developerway.com/posts/fantastic-closures 💬 Twitter: adevnadia 💬 Linkedin: www.linkedin.com/in/adevnadia/ 👩🏼‍💻 Initial "mystery" code example: codesandbox.io/s/example1-925swq?from-embed=&file=/App.tsx 👩🏼‍💻 Cached closure without React code example: codesandbox.io/s/example2-xx4xq3 ...
React reconciliation: how it works and why should we care
Просмотров 13 тыс.Год назад
👉 Advanced React Book: www.advanced-react.com 👉 React reconciliation: how it works and why should we care: www.developerway.com/posts/reconciliation-in-react ⃗💬 Twitter: adevnadia 💬 Linkedin: www.linkedin.com/in/adevnadia/ 👩🏼‍💻 The mystery of conditional rendering: codesandbox.io/s/keen-fog-vrujk7?file=/src/App.tsx 👩🏼‍💻 How to fix it with re-positioning: codesandbox.io/s/re-position...
Say no to "flickering" UI: useLayoutEffect, painting and browsers story
Просмотров 8 тыс.Год назад
👉 Advanced React Book: www.advanced-react.com 👉 Say no to "flickering" UI: useLayoutEffect, painting and browsers story: www.developerway.com/posts/no-more-flickering-ui 💬 Twitter: adevnadia 💬 Linkedin: www.linkedin.com/in/adevnadia/ 👩🏼‍💻 simple navigation with useEffect, broken: codesandbox.io/s/simple-responsive-menu-example-ltdx5r 👩🏼‍💻 simple navigation with useLayoutEffect, fixe...
Refs in React: from access to DOM to imperative API
Просмотров 4,9 тыс.Год назад
👉 Advanced React Book: www.advanced-react.com 👉 Refs in React: from access to DOM to imperative API: www.developerway.com/posts/refs-from-dom-to-api 💬 Twitter: adevnadia 💬 Linkedin: www.linkedin.com/in/adevnadia/ 👩🏼‍💻 Simple ref use: codesandbox.io/s/giant-form-ref-example-23z9vf 👩🏼‍💻 Pass ref as a prop: codesandbox.io/s/example2-pass-ref-as-prop-5i03u9 👩🏼‍💻 Pass ref with forwardRef...
The mystery of React key: how to write performant lists
Просмотров 6 тыс.Год назад
👉 Advanced React Book: www.advanced-react.com 👉 Comprehensive guide on React re-renders (www.developerway.com/posts/react-re-renders-guide) 👉 How to useMemo and useCallback: you can remove most of them (www.developerway.com/posts/how-to-use-memo-use-callback) 👉 React key attribute: best practices for performant lists (www.developerway.com/posts/react-key-attribute) 💬 Twitter: adevna...
useCallback for re-renders: remove most of them
Просмотров 8 тыс.Год назад
👉 Advanced React Book: www.advanced-react.com 👉 Comprehensive guide on React re-renders (www.developerway.com/posts/react-re-renders-guide) 👉 How to useMemo and useCallback: you can remove most of them (www.developerway.com/posts/how-to-use-memo-use-callback) 👉 The mystery of React Element, children, parents and re-renders (www.developerway.com/posts/react-elements-children-parents) 💬 Twitter: ...
Preventing re-renders with React.memo
Просмотров 6 тыс.Год назад
👉 Advanced React Book: www.advanced-react.com 👉 Comprehensive guide on React re-renders (www.developerway.com/posts/react-re-renders-guide) 👉 How to useMemo and useCallback: you can remove most of them (www.developerway.com/posts/how-to-use-memo-use-callback) 👉 The mystery of React Element, children, parents and re-renders (www.developerway.com/posts/react-elements-children-parents) 💬 Twitter: ...
Preventing React re-renders with composition
Просмотров 24 тыс.Год назад
👉 Advanced React Book: www.advanced-react.com 👉 Comprehensive guide on React re-renders (www.developerway.com/posts/react-re-renders-guide) 👉 How to useMemo and useCallback: you can remove most of them (www.developerway.com/posts/how-to-use-memo-use-callback) 👉 The mystery of React Element, children, parents and re-renders (www.developerway.com/posts/react-elements-children-parents) 💬 Twitter: ...
Why React components re-render?
Просмотров 15 тыс.2 года назад
Why React components re-render?

Комментарии

  • @daniel.w8112
    @daniel.w8112 18 часов назад

    This was just amazing! subscribed.

  • @jujuwitzke
    @jujuwitzke День назад

    How should I decide when to use this approach or react memo? I love your videos btw

  • @ArturZalewski
    @ArturZalewski День назад

    Golden 🙏

  • @LauraLopez-uu2nn
    @LauraLopez-uu2nn 2 дня назад

    Thanks so much for creating this type of content, it's so engaging and interesting to watch. After watching this I became curious about the virtual dom, is there any way to see what it actually looks like in a real React app?

    • @developerwaypatterns
      @developerwaypatterns 2 дня назад

      The entire three you mean? No idea But you can just console.log an element and see the type and the props and other things there

  • @lifeisbeautifu1
    @lifeisbeautifu1 2 дня назад

    ❤❤❤❤

  • @diggin8741
    @diggin8741 2 дня назад

    So??????? Where is the next episode? My baby is crying for it... <3

  • @codecrash_t132
    @codecrash_t132 4 дня назад

    I genuinely admire your work.. it’s simply outstanding.

  • @martinmora5730
    @martinmora5730 4 дня назад

    Thank you, really good video

  • @rahulkhandelwal7034
    @rahulkhandelwal7034 6 дней назад

    Fantastic Explanation Love from India

  • @hieu_nguyen_20
    @hieu_nguyen_20 9 дней назад

    How can I check the time?

  • @ikbo
    @ikbo 9 дней назад

    have you thought of releasing a react 19 course so you can take my money?

  • @khaledloda5418
    @khaledloda5418 11 дней назад

    Thanks for Great explanation , but want ask about create component inside another we can use useCallback to create component it works fun ?!! ex const CustomInput = useCallback(() => { console.log("rendering custom input"); return <input placeholder="test custom input" />; }, []);

    • @developerwaypatterns
      @developerwaypatterns 11 дней назад

      Like this, without any dependencies - yep, but what for? :) And as soon as dependencies appear there, the component will be re-created and as a result - the same problem with re-mounting

  • @EmmanuelOdii80
    @EmmanuelOdii80 13 дней назад

    I honestly wished i could like this video twice!

  • @patrioticgrind
    @patrioticgrind 14 дней назад

    You are truly an expert if your craft. I’ve watched other 1hr videos explain the solution to re-renders and still don’t get it. Ty so much! I’m buying your book.

  • @kritidiptoghosh4272
    @kritidiptoghosh4272 14 дней назад

    THis is definitely the clearest explanation on uselayoutEffect. Everyone else is just mentioning the "it does things synchronously" and thats it.

  • @FrontEndChampion
    @FrontEndChampion 16 дней назад

    Really valuable, thanks!

  • @FrontEndChampion
    @FrontEndChampion 16 дней назад

    Really good!!

  • @gabrielaparecidodasilva156
    @gabrielaparecidodasilva156 18 дней назад

    Please , dont stooppppp !!! You're f*cking amazing !!!

  • @gmuthu20
    @gmuthu20 21 день назад

    One clarification, for the last scenario still we can send the SlowComponents as children to the Layout component like <Layout>{[<SlowComponent key={1}/> <BunchOfSlowComp key={2} />]}</Layout>.

  • @WilliamRoberts-x3c
    @WilliamRoberts-x3c 22 дня назад

    Hi, really nice videos, what theme do you use for the code, it looks very nice?

  • @willroberts1891
    @willroberts1891 25 дней назад

    Hi great videos thanks! How did you make your code animate from one to another?

  • @ahsaninkiad4781
    @ahsaninkiad4781 26 дней назад

    This is simply the best explanation

  • @pez5491
    @pez5491 26 дней назад

    Best explanation of react design patterns i've ever seen

  • @johnkucharsky6927
    @johnkucharsky6927 29 дней назад

    It's wrong pattern. You should never use it. Read react docs, "If you’re not trying to synchronize with some external system, you probably don’t need an Effect."

    • @developerwaypatterns
      @developerwaypatterns 29 дней назад

      Which pattern you're referring to? This video doesn't have any patterns, it's a video about closures and how they appear in React components. The only thing that remotely resembles a pattern, is syncing state with ref inside useEffect at the very end, which is just an example of how to break away from closured, to provide a deeper understanding of them. It's not about how to use useEffect.

    • @johnkucharsky6927
      @johnkucharsky6927 29 дней назад

      @@developerwaypatterns ok, probably I got that wrong. I have understood the end of video is solving the mistery from start of the video

  • @Txous77
    @Txous77 29 дней назад

    Just thinking crazy (to check if I understood OK). Could you also avoid re rendering you mention if you code the example like this?: Instead of passing a prop with "content", create a Content component and export it, then import that Content in ScrollableWithMovingBlock AND assign it to a ref like: cont myContent = usRef(Content), and finally rendering it like: {myContent.current}

    • @developerwaypatterns
      @developerwaypatterns 29 дней назад

      If you never update that ref, then in theory might work 🤔 But props likely would have to be primitives or no props at all - would need to test and see, very likely that something weird will be happening here And it will look crazy for anyone who's looking at the code 😅

    • @Txous77
      @Txous77 29 дней назад

      @developerwaypatterns Amazing videos, by the way. Love cats teaching React. LOL Regards from Spain

  • @tejaskasare6840
    @tejaskasare6840 Месяц назад

    Like how????? How much efforts you have taken so far! You are gem !!!

  • @lqueryvg
    @lqueryvg Месяц назад

    FYI, I think there's an error on this page: ruclips.net/video/pNaW0Md2o0g/видео.html I think the closing tag should be: </ScrollDetector>

  • @madhawapriyashantha3722
    @madhawapriyashantha3722 Месяц назад

    really interesting unique video series .thanks

  • @shivanshmehrotra9986
    @shivanshmehrotra9986 Месяц назад

    Found this after my interviews 🥲. Definitely need a complete video series on advanced concepts.

  • @丂卂丂乇匚卄丨卄卂
    @丂卂丂乇匚卄丨卄卂 Месяц назад

    thanks.. very informative

  • @lqueryvg
    @lqueryvg Месяц назад

    Thank you for explaining the myth about props changes not triggering re-render. I've been confused about this for a long time and finally many things become clearer.

  • @saragholampour8448
    @saragholampour8448 Месяц назад

    When state is true the create element is call for Input and when state change to false , we have another createElement , why Input's have same reference?

    • @developerwaypatterns
      @developerwaypatterns Месяц назад

      Can you link the slide you're referring to? This episode is quite large and covers a lot :)

  • @paulca55
    @paulca55 Месяц назад

    Great series, I keep coming back to it time and time again. At 9:12 you mention if a component is wrapped in React.memo and it's re-render is triggered by the parent and "only" by the parent, then React won't re-render the memoized component. I may be misunderstanding, but is that to suggest that if state changes higher up in the element tree where 'Parent' is used, that the memoized component (MemoChild) will always re-render?

    • @developerwaypatterns
      @developerwaypatterns Месяц назад

      Ah, no :) If the re-renders come from parent of the parent, the same rules apply. If the memoization is correct, then the memoized component won't re-render. By "parent and only parent" I meant that memoization won't prevent re-renders that originated from state change inside the MemoChild itself, and the context changes if MemoChild uses Context.

  • @lqueryvg
    @lqueryvg Месяц назад

    Excellent ! Brilliant explanation.

  • @jerbear97
    @jerbear97 Месяц назад

    quick question: where have you been these past 2 years when I was starting to learn react?

  • @SalaudeenWarees
    @SalaudeenWarees Месяц назад

    Am I wrong in thinking that we could achieve the same result using the useRef hook to hold the scroll position, given that useRef does not trigger re-renders and is powerful for direct DOM manipulations

    • @developerwaypatterns
      @developerwaypatterns Месяц назад

      It's not exactly the same result - if you use Ref for this, you won't be able to use the scroll value in render function of any component. So could only work if you need this value inside useEffect or callback.

    • @SalaudeenWarees
      @SalaudeenWarees Месяц назад

      @@developerwaypatterns okay noted

  • @ManishGupta-nv5by
    @ManishGupta-nv5by Месяц назад

    hey i really loved your contents but gonna see your blog if you had added react 19 into content.

  • @oscarmamani5996
    @oscarmamani5996 Месяц назад

    Amazing video 🎉

  • @ManishGupta-nv5by
    @ManishGupta-nv5by Месяц назад

    didn't get reset part going to watch again.

  • @ManishGupta-nv5by
    @ManishGupta-nv5by Месяц назад

    i don't quite get what you mean by last sentence........

  • @ManishGupta-nv5by
    @ManishGupta-nv5by Месяц назад

    when video started i feel this is not way nadia teaches she doesn't explain why remove it.

    • @developerwaypatterns
      @developerwaypatterns Месяц назад

      Check out the Advanced React series in this channel - those videos are newer and explain memoization related concepts better :)

    • @ManishGupta-nv5by
      @ManishGupta-nv5by Месяц назад

      @developerwaypatterns well I am gonna watch all. Newer ones will refreshes the concepts.

  • @ManishGupta-nv5by
    @ManishGupta-nv5by Месяц назад

    love from manish gupta, i start loving you after watching your content. :)

  • @ManishGupta-nv5by
    @ManishGupta-nv5by Месяц назад

    when i stuck on how to improve my react code i come across your video, after watching that video i started seeing from your first one. going to see all and implement in my code and after reading comment i found out you have a blog also going to watch that. i will appreciate you content more often.

  • @qantar8167
    @qantar8167 Месяц назад

    This was such a quick, simple and clear explanation! Really appreciate the effort and time it took to do such wonderful work, thank you a lot!

  • @mkacodes
    @mkacodes Месяц назад

    it's just the first episode, but i'm already solved a lot of re-rendering issues. Thank you

  • @avimonnudash1762
    @avimonnudash1762 2 месяца назад

    Thank you

  • @silventin0
    @silventin0 2 месяца назад

    Very good content!

  • @ankitjangid2277
    @ankitjangid2277 2 месяца назад

    fantastic video !!! but i have one doubt i hope you would explain me this better so my doubt is in this video code example you are using HeavyComponent and everytime the parent component will re render the HeavyComponent will also re render but in react they say that in component only that part will be re render that is got changed and other element will not re render so here why heavyComponent will re render again even it will be same for all re renders of parent component.

    • @developerwaypatterns
      @developerwaypatterns 2 месяца назад

      Can you link where in React they say that only the changed part will re-render? This is not true, assuming that the Compiler is not enabled, so it's probably a mistake somewhere :)

  • @ey_Yõlovchi
    @ey_Yõlovchi 2 месяца назад

    amazing explanation