How different is React components interaction from javascript and HTML in the DOM?

Question

How different is React components interaction from javascript and HTML in the DOM?

Answer

It is about a few different things on the approach, while you would normally have the browser rendering each HTML file with event listeners from your javascript file so we can interact with the DOM, then again, that makes us have to create multiple HTML pages with their own JavaScript file.

When we talk about components interaction, we do not even think about how they interact with the DOM, but it all happens before they communicate anything to the browser, so by having component interaction we can set any changes needed and once done, React sends them to the browser, so it becomes more efficient to provide content that way if it is mainly streamlined through JavaScript.