Why is componentDidMount a good place to make API calls?
componentDidMount is a good place to make API calls because the component is already rendered in the DOM at this point. This means you can update the state with the API response without worrying about trying to update a component that hasn't mounted yet, and the user can see the initial render while waiting for data.