Answer the question
In order to leave comments, you need to log in
Why does document.getElementById return null in react?
Why does document.getEelementById return null in react even though it works when called from console?
Answer the question
In order to leave comments, you need to log in
Because the moment you call this method inside react, your component has not yet been mounted or rendered. React doesn't intentionally break standard methods to make it harder for you to work. Show your code and we can explain to you what exactly you are doing wrong.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question