Answer the question
In order to leave comments, you need to log in
Why is the element missing?
Hello, there is a list with elements, to which one more element has been added with the help of appenChild. When the state changes, the list is redrawn, but the element remains. If the element was added using js, then it still remains in the dom?
Answer the question
In order to leave comments, you need to log in
React is not aware of what else you are adding to the dom.
You can give the entire list a key and change that key so that the entire list node is deleted and recreated - then the left element disappears.
But in general, it’s better not to add anything bypassing the react
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question