The way you explain this stuff is fantastic. Absolutely love it. As a beginner this helps so much because lots of other videos explain a concept but they pretend like we can already dream all the other concepts and things in react that interact with that concept, so they go really fast just to demonstrate the thing the video is about. That requires me to sometimes pause the video, try to understand exactly what it is they did, rewind and go over it again. You pretty much explain (and/or demonstrate) every aspect of what's happening which also further makes me understand the other aspects of react to a deeper level. I will 100% check out your other react stuff after this. Keep this up and you will get like 100k subs in no time. You are appreciated
@TechWithNader Жыл бұрын
Awesome, thanks for the kind words! 😊 Hope you enjoy the rest of the videos and don't hesitate to ask questions as you go or on the Discord :)
@probablyforget Жыл бұрын
Bro, you're so good. Never stop what you're doing, thanks so much for this.
@charukirticc3 ай бұрын
Amazing video, really helped me to understand this useEffect hook. Thanks a lot!
@bohdanartemenko9 ай бұрын
This is truly the best explanation I saw on KZbin
@aliajellu4 ай бұрын
An amazing way to teach this. thanks brother.
@RomanFilenko Жыл бұрын
this in-depth video was very usefull, thanks for you work, Nader🙂
@TechWithNader Жыл бұрын
You're very welcome, Roman! Glad you found it helpful 🤓
@farookahmed44968 ай бұрын
Lots of respect and love please keep up with such a quality content. I hope your channel will grow up. ❤
@sambhavsharma278010 ай бұрын
🎯 Key Takeaways for quick navigation: 00:00 *🔍 Introduction to useEffect hook* - The useEffect hook in React is crucial for managing side effects in functional components. - It can initially seem confusing due to its nuances and various use cases. - The hook is designed to run side effects in components, interacting with external systems outside of React. 02:19 *🔄 Core functionality and purpose of useEffect* - useEffect is primarily used to run side effects in React components. - It allows components to interact with external systems such as the DOM, databases, APIs, etc. - The hook provides a way to synchronize with the component lifecycle, including mounting, updating, and unmounting stages. 05:19 *📚 Examples of useEffect use cases* - Common use cases for useEffect include data fetching from APIs, setting up event listeners, using intersection observers, handling observables and subscriptions, etc. - useEffect is versatile and essential for managing component side effects in React applications. 06:41 *🔄 Understanding the component lifecycle and useEffect* - A grasp of the React component lifecycle aids in understanding how useEffect operates. - useEffect allows developers to hook into different lifecycle stages, including mounting, updating, and unmounting. - It serves as the functional equivalent of class-based lifecycle methods like componentDidMount, componentDidUpdate, and componentWillUnmount. 09:18 *💡 Syntax and usage of useEffect* - The useEffect hook is imported from the React library. - Its signature includes a function as the first argument and an optional dependency array as the second argument. - The function parameter dictates what the useEffect hook should do, while the dependency array controls when it should execute. 18:29 *🛠️ Managing State with useState hook* - Demonstrating the creation of an arrow function to update state using the `useState` hook. - Explanation of the necessity to use a callback function to avoid immediate state updates. - Illustrating how state updates trigger component re-renders. 19:38 *🔄 useEffect hook behavior on component mount* - Explaining that the `useEffect` hook runs only once when the component mounts. - Demonstrating the behavior of the `useEffect` hook by logging messages on component mount and update. - Clarifying the distinction between mounting and updating components in React. 21:31 *🔄 useEffect hook behavior on component re-renders* - Showing how the `useEffect` hook runs on every component re-render without a dependency array. - Highlighting that without a dependency array, the effect runs on every re-render, not just on component mount. - Illustrating the importance of managing the useEffect dependencies for controlling when the effect should run. 25:11 *⚛️ Controlling useEffect with dependencies* - Demonstrating the use of a dependency array in `useEffect` to specify when the effect should run. - Explaining that the effect runs only when the specified state variable in the dependency array changes. - Showing how to use multiple state variables in the dependency array for fine-grained control over when the effect runs. 32:11 *🧹 Cleaning up with useEffect cleanup function* - Introducing the concept of cleanup functions in the `useEffect` hook. - Explaining the importance of cleanup functions for handling side effects and preventing memory leaks. - Demonstrating how to return a cleanup function from `useEffect` to execute cleanup logic when the component unmounts. 37:35 *🧗♂️ Understanding the mounting process in React's useEffect hook* - React executes cleanup functions specified in useEffect when components unmount. - React runs useEffect twice in development mode to ensure proper cleanup, but only once in production. - The mounting process in useEffect can be observed through console logs during development. 40:09 *🔄 React's useEffect hook testing effects cleanup and re-rendering* - useEffect ensures proper cleanup by running the cleanup function before re-rendering. - Re-rendering triggers cleanup of the previous useEffect and execution of the new useEffect. - Continuous re-rendering without proper cleanup can lead to memory leaks and performance issues. 45:05 *⚠️ Addressing issues of cleanup and re-rendering in React's useEffect hook* - Lack of proper cleanup in useEffect can lead to unexpected behavior like repeated execution of side effects. - Proper cleanup involves clearing intervals, unsubscribing from observers, or closing resources to prevent memory leaks. - useEffect's dependency array and cleanup functions help manage side effects and ensure efficient component behavior. 55:52 *🧹 Importance of proper cleanup in useEffect and its implications* - Neglecting cleanup in useEffect can lead to memory leaks and various bugs, impacting application performance. - Complex side effects like intervals or fetch requests require careful cleanup to prevent issues like server overload. - Understanding when to perform cleanup within useEffect ensures efficient resource management and application stability. 56:34 *🌳 Conceptualizing React components and effects within a DOM tree structure* - React components and effects operate within a hierarchical DOM tree managed by React. - Re-renders propagate through the component tree, affecting child components based on changes in parent components. - Awareness of the DOM tree structure helps in understanding the cascade of re-renders and their impact on component behavior. 58:12 *⏰ Asynchronous execution of useEffect and component rendering in React* - useEffect and component rendering in React are asynchronous processes scheduled and managed by React. - React maintains an internal queue for executing useEffect functions in the order they are defined. - Placing side effects within useEffect ensures non-blocking execution, optimizing application performance and rendering efficiency. Made with HARPA AI
@nipunkumar7164 Жыл бұрын
wow, loved this! thanks. the debugging of the the cleanUp function was so so challenging. Obv i didn't get whole of it, but i know some which is not a bad thing ig. Thanks again man! Awesome
@abhishekbhadauria222610 ай бұрын
Keep going on... ! Nice one
@FrontendNerd-lg3oh8 ай бұрын
amazin g brother
@blackc1t199 Жыл бұрын
Hey nader can we have also videos about functional paradigm in js Ihad fun and learn alot in OOP list And looking for functional paradigm to Beacuse it's good to