React.js, Is `DOMContentLoaded` equal with `componentDidMount`?

dom, reactjs

Solution

The `DOMContentLoaded` event is exclusive to when the entire HTML page loads. Therefore, this event is only fired once and only once, throughout the entirety of the web page's lifetime. `componentDidMount`, on the other hand, is called when a React component is rendered. Therefore, it is entirely possible for `componentDidMount` to be called several times, albeit for entirely different instances of the same component's class.

And yes, the browser's DOM is always in the "ready state", at the time when a `componentDidMount` event is called.

Problem

People always say that you can get the `dom` in `componentDidMount`. Is that mean `componentDidMount` and `DOMContentLoaded` are synchronous, or does it mean when `componentDidMount`, the `dom` is always ready?

Original source