Answer the question
In order to leave comments, you need to log in
Is it possible to use findDOMNode and querySelectorAll in React?
Faced with the task of removing all classes in certain components of an element, and adding an active class to the current element of the current component, since there is no access to other elements through ref due to the fact that they are in different components, I do this as follows:
let titles = ReactDOM.findDOMNode(this).parentNode.parentNode.querySelectorAll('.wrp_desk_title textarea');
titles.forEach( item => {
item.classList.remove('title_active');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question