Knowing that ReactJS uses a virtual DOM where elements are rendered in a DOM representation in memory so that all changes are made faster then it would be "wrong" to use findDOMNode to directly access a DOM element and manipulate your state?
Knowing that ReactJS uses a virtual DOM where elements are rendered in a DOM representation in memory so that all changes are made faster then it would be "wrong" to use findDOMNode to directly access a DOM element and manipulate your state?
Yes, it would be wrong.
findDOMNode
exists only for reading DOM information (ex: position, value of form fields, etc.). Modifying DOM
directly can also cause inconsistencies, because the view that framework
has DOM (virtual-dom)
will not be the same as DOM
in the browser, so it may end up overwriting the values you set manually. >