Hi I’ve been practised from the Learn React: Hands-On Guide to Building Web Applications Using React and Redux (2nd Edition).
I am currently viewing the chapter 3 on the component. When I try to follow through and see the output on browser nothing seems appear. Any idea why? I’m a starter, please bear with me.
Can you post your full code? I’m only seeing bits and pieces in the response. Also, if you bring up your browser developer tools, do you see any error showing up?
react-dom.development.js:27710 Uncaught Error: Target container is not a DOM element.
at Object.render (react-dom.development.js:27710)
at <anonymous>:4:10
at n (babel.min.js:12)
at r (babel.min.js:12)
at o (babel.min.js:12)
at u (babel.min.js:12)
at E (babel.min.js:1)
@jopeters you’re missing a div element. Add this above the <script> tag:
<div id="container"></div>
This is what document.querySelector("#container"); is looking for and assigns to destination, what will be the “target container”. When not found, destination becomes null and React can’t render to it.
Creating engaging and entertaining content for designers and developers since 1998.