React Lifecycle: Why componentDidMount() is great for a smooth API call

When you are buying groceries to make dinner, you can’t start preparing the ingredients – chopping the onions, washing the radishes – until you’ve paid for the groceries and driven home, can you? This wouldn’t make sense. Similarly, in React we can’t make modifications to a component until it has been mounted. This is where …

React Lifecycle: Why componentDidMount() is great for a smooth API call Read More »