In this assignment, I learned how to effectively use the useEffect hook in React and how dependencies work within it. Additionally, I explored how to handle scroll events to perform multiple tasks in response to user interactions.
The useEffect hook allows us to perform side effects in functional components, such as fetching data, directly interacting with the DOM, or setting up subscriptions. Understanding its dependency array is crucial to ensure that effects run only when necessary.
I implemented scroll event listeners to execute tasks based on the scroll position of the window. This allows for dynamic behavior in the application, such as updating a counter, changing styles, or triggering animations.