- Видео 16
- Просмотров 229 367
Developer Way
Австрия
Добавлен 8 янв 2023
Advanced patterns for Frontend developers.
Improve your technical skills with in-depth explanations, practical advices and useful tips and tricks.
Techstack: React, Typescript, node, monorepos, yarn, webpack, etc.
www.advanced-react.com
www.developerway.com
Improve your technical skills with in-depth explanations, practical advices and useful tips and tricks.
Techstack: React, Typescript, node, monorepos, yarn, webpack, etc.
www.advanced-react.com
www.developerway.com
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/
🎬 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: ...
This was just amazing! subscribed.
How should I decide when to use this approach or react memo? I love your videos btw
Golden 🙏
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?
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
❤❤❤❤
So??????? Where is the next episode? My baby is crying for it... <3
Life got in the way! 😭
I genuinely admire your work.. it’s simply outstanding.
Thank you, really good video
Fantastic Explanation Love from India
How can I check the time?
have you thought of releasing a react 19 course so you can take my money?
thought about it, maybe some day :)
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" />; }, []);
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
I honestly wished i could like this video twice!
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.
THis is definitely the clearest explanation on uselayoutEffect. Everyone else is just mentioning the "it does things synchronously" and thats it.
Really valuable, thanks!
Really good!!
Please , dont stooppppp !!! You're f*cking amazing !!!
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>.
Hi, really nice videos, what theme do you use for the code, it looks very nice?
Sorry, i don't remember for this one, was long time ago
Hi great videos thanks! How did you make your code animate from one to another?
It's "magic move" in Keynote :)
This is simply the best explanation
Best explanation of react design patterns i've ever seen
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."
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.
@@developerwaypatterns ok, probably I got that wrong. I have understood the end of video is solving the mistery from start of the video
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}
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 😅
@developerwaypatterns Amazing videos, by the way. Love cats teaching React. LOL Regards from Spain
Like how????? How much efforts you have taken so far! You are gem !!!
Too much 😅
FYI, I think there's an error on this page: ruclips.net/video/pNaW0Md2o0g/видео.html I think the closing tag should be: </ScrollDetector>
Ooops, indeed! 🤦🏼♀️
really interesting unique video series .thanks
Found this after my interviews 🥲. Definitely need a complete video series on advanced concepts.
thanks.. very informative
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.
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?
Can you link the slide you're referring to? This episode is quite large and covers a lot :)
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?
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.
Excellent ! Brilliant explanation.
quick question: where have you been these past 2 years when I was starting to learn react?
Hidden behind google algorithms 😅
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
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.
@@developerwaypatterns okay noted
hey i really loved your contents but gonna see your blog if you had added react 19 into content.
Amazing video 🎉
didn't get reset part going to watch again.
i don't quite get what you mean by last sentence........
when video started i feel this is not way nadia teaches she doesn't explain why remove it.
Check out the Advanced React series in this channel - those videos are newer and explain memoization related concepts better :)
@developerwaypatterns well I am gonna watch all. Newer ones will refreshes the concepts.
love from manish gupta, i start loving you after watching your content. :)
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.
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!
it's just the first episode, but i'm already solved a lot of re-rendering issues. Thank you
Thank you
Very good content!
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.
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 :)
amazing explanation