I am going to make my first React project, and in my reading it became clear that I need to allow React to handle all rendering with the virtual DOM and that I should not perform any manual DOM operations that would interfere with virtual DOM calculations.
However, I cannot understand what this is:
Suppose I have a React component displayed in div #app on a page with different HTML. Does this mean that I should refrain from any normal JavaScript DOM operations anywhere on the page? Or can I safely use DOM operations elsewhere on the page as long as I leave divs and elements #apponly inside the actual React component?
EDIT: Motivational use case.
My reason for considering that non-React components manipulate the DOM outside of the React component is basically that HTML can be seen on Google without jumping over a lot of hoops. Suppose I need some descriptive text about an application that will be useful for SEO, and this description may have some pop-up menus, etc. (Hence the DOM problem). Should I really want / need to write everything in React just because the complex user interface of the application uses React if cost makes some text difficult to index Google?
source
share