The way you have it it runs before you even have DOM.
You should include it in the bottom like so:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>REACT TEST</title> </head> <body> <div id="app"></div> <script src="./bundle.js"></script> </body> </html>
Related Posts:
- How to import image (.svg, .png ) in a React Component
- Uncaught TypeError: Cannot read property ‘call’ of undefined at __webpack_require__
- how to use react require syntax?
- where is create-react-app webpack config and files?
- Invariant Violation: Objects are not valid as a React child
- “SyntaxError: Unexpected token < in JSON at position 0"
- What is Virtual DOM?
- How to use Redirect in the new react-router-dom of Reactjs
- React.js: Set innerHTML vs dangerouslySetInnerHTML
- Babel 7 – ReferenceError: regeneratorRuntime is not defined
- React – uncaught TypeError: Cannot read property ‘setState’ of undefined
- Understanding unique keys for array children in React.js
- How to do a redirect to another route with react-router?
- Jest spy on functionality
- Difference between npx and npm?
- I am getting an “Invalid Host header” message when connecting to webpack-dev-server remotely
- Reactjs – Form input validation
- TypeScript React.FC
confusion - Error Running React Native App From Terminal (iOS)
- Axios Delete request with body and headers?
- Loop inside React JSX
- Can’t resolve module (not found) in React.js
- How to implement navbar using react
- Loop inside React JSX
- Understanding React-Redux and mapStateToProps()
- how to render a react component using ReactDOM Render
- React this.setState is not a function
- Console logging for react?
- ‘react-scripts’ is not recognized as an internal or external command
- After $npm install, Getting Error: Cannot find module ‘../lib/utils/unsupported.js’
- React Native: this.setState is not a function
- React: trigger onChange if input value is changing by state?
- In reactJS, how to copy text to clipboard?
- SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag
- You should not use Route or withRouter() outside a Router when using react-router 4 and styled-component in react
- React-Router only one child
- What does the className attribute mean in JSX?
- Getting Unexpected Token Export
- React Hook Warnings for async function in useEffect: useEffect function must return a cleanup function or nothing
- Setting a backgroundImage With React Inline Styles
- What is the difference between state and props in React?
- How to pass props to {this.props.children}
- React eslint error missing in props validation
- OnChange event using React JS for drop down
- ESLint Parsing error: Unexpected token
- Module not found can’t resolve
- Setting onSubmit in React.js
- Uncaught TypeError: Cannot read property ‘props’ of null
- ReactJS: setTimeout() not working?
- How to refresh a Page using react-route Link
- React Error: Target Container is not a DOM Element
- How to implement authenticated routes in React Router 4?
- React Js: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
- Console is throwing Unterminated JSX contents error
- How to scroll to an element?
- setInterval in a React app
- Cannot read property ‘bind’ of undefined. React.js
- How do you Hover in ReactJS? – onMouseLeave not registered during fast hover over
- Failed to compile. Module not found: Can’t resolve ‘react-router-dom’
- ReactJS: setTimeout() not working?
- How to add multiple classes to a ReactJS Component?
- Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode
- Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode
- module.exports “Module is not defined”
- how to download file in react js
- Trying to use fetch and pass in mode: no-cors
- React’s setState method with prevState argument
- onEnter not called in React-Router
- Pass react component as props
- Objects are not valid as a React child. If you meant to render a collection of children, use an array instead
- Async/await in componentDidMount to load in correct order
- Why use Redux over Facebook Flux?
- Local package.json exists, but node_modules missing
- react router v^4.0.0 Uncaught TypeError: Cannot read property ‘location’ of undefined
- Access Control Origin Header error using Axios
- Cannot read property ‘getHostNode’ of null
- Can’t perform a React state update on an unmounted component
- onClick not working React js
- How can I use webpack with express?
- This.props.dispatch not a function – React-Redux
- How to add a keyboard listener to my onClick handler?
- How to add a keyboard listener to my onClick handler?
- React router not showing browser history
- e.target.value on an input field ReactJs, how does it work?
- Uncaught Invariant Violation: Rendered more hooks than during the previous render
- command not found: jest
- Jest encountered an unexpected token
- How to allow CORS in react.js?
- Uncaught ReferenceError: React is not defined
- What do these three dots in React do?
- Expected ‘this’ to be used by class method
- How to disable button in React.js
- Update style of a component onScroll in React.js
- What are differences between SystemJS and Webpack?
- “You may need an appropriate loader to handle this file type” with Webpack and Babel
- Correct modification of state arrays in React.js
- JSX not allowed in files with extension ‘ .js’ with eslint-config-airbnb
- “React.Children.only expected to receive a single React element child” error when putting
and in a - Getting “Cannot call a class as a function” in my React Project
- Await is a reserved word error inside async function