When is componentDidUpdate() called in the component lifecycle?
The componentDidUpdate() method is called after the update has been committed to the DOM. This means the component has re-rendered and the changes have been applied to the actual DOM. It's the ideal place to perform side effects based on the new state or props, such as network requests or DOM manipulations, as long as they're wrapped in a condition to prevent infinite loops.