Introduction
Lifecycle hooks let you run code exactly when your component starts, updates, or ends. This helps you control what happens at important times.
When you want to fetch data right after a component appears on the screen.
When you need to clean up timers or event listeners before a component disappears.
When you want to react to changes in component data or props.
When you want to set up animations when a component is created.
When you want to log or track component behavior during its life.