Reactjs 0.12 Target Container Is Not A Dom Element
I am very confused as to why I am getting this error in the console. I have read all the dos and as far as I know I am doing this right. On my page I have a
Solution 2:
The following piece of code tries to find the element with ID aisis-writer
where it says document.getElementById('aisis-writer')
but it's not able to find that on the page.
React.render(
<AisisWriter />,
document.getElementById('aisis-writer')
);
This may happen because
- JavaScript is executed before the line
<div id="aisis-writer"></div>
- Or, you might have mis-spelt ID
Answer :
- Either you can place the
React.render
statements inwindow.onload
- Or, make sure,
React.render
appears only after<div id="aisis-writer"></div>
on the page
Post a Comment for "Reactjs 0.12 Target Container Is Not A Dom Element"