score:1
Accepted answer
You need to use the render
function correctly:
render(
<div>
Hello react!
</div>,
document.getElementById('root')
);
(Instead of render { ... }
)
score:0
I think you're missing the Babel configuration, either in webpack (in the loaders
section) or the .babelrc
file itself. You need to tell Babel to process your code and apply the react
preset.
If you post your webpack.config.js and .babelrc we'll be able to point the specific missing part.
Otherwise you may want to take a look into the create-react-app
package which is a great and official way to kickstart a React app.
Source: stackoverflow.com
Related Query
- React - error while collecting modules by webpack
- Error while configuring CSS modules with webpack
- Webpack 5 Receiving a Polyfill Error?!?! My JavaScript React project is receiving a polyfill error while trying to compile my webpack.config.js file
- How to solve an error while trying to npm i the modules in a React project
- Error using css modules in typescript react with webpack config
- Invalid configuration error while creating a react app with webpack configuration
- Error while importing font or images file inside scss using Webpack 4 and react js
- REACT ERROR WHILE IMPORTING THE REACT MODULES
- useing web3 in React has error : webpack < 5 used to include polyfills for node.js core modules by default
- How to import CSS modules with Typescript, React and Webpack
- Error while creating new React app ("You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0)")
- I'm getting error like this while creating react app
- Use CSS Modules in React components with Typescript built by webpack
- Why I got Error while Creating React App?
- CORS error while consuming calling REST API with React
- Azure App Service Getting error while deploying REACT JS application
- Error while running react application
- Error using component done with react,redux and react-redux and build with webpack in react application
- React + Reactstrap + CSS Modules + Webpack
- Error while deploying react based SSR app, using firebase-functions
- Symlinking react modules with npm link for local development gives error
- Webpack dev server React Content Security Policy error
- How to disable strict mode while bundling React using webpack
- Keep getting error while creating react app
- Using one webpack project inside another with react hooks causes an error
- Getting error "Path" argument must be string while deploying React - Loadable components sample code in cloud functions
- Visual Studio code error while saving react files?
- Uncaught ReferenceError: regeneratorRuntime is not defined in react 17, webpack 5 while making api calls through actions
- Webpack with react modules giving unexpected token
- How to hide console status error message while fetching in React js?
More Query from same tag
- ReactJs How to re-call API after initial render?
- React - problems with useState and Firebase
- How to extend a page in Nextjs. Like a nested switch in react-router-dom
- GraphQL + React: Could not find "client" in the context or passed in as an option
- Most "react" way to have multiple different renderings
- How to call 2 functions after the setState is called in React?
- React component does no re-render when it is swapped with the same one
- Can I get a point along an SVG path without rendering it?
- Returning an array populated by promise.all()
- Tabulator: Fix position of right most column when adjusting table column width
- Display elements from JavaScript object with Object.entries
- Trouble Getting Component to Render in setTimeout
- Where should i set a Variable if want to access it in my whole React app?
- Display html markup in react jsx
- Enzyme testing for presence of a class set by CSS-In-JS in React
- React confirm modal and redux middleware
- React router not rendering components due to its structure
- How to control ReactJS MUI table column height and width
- Error happens when API returns JSON, Each child in a list should have a unique "key" prop
- React componentDidUpdate() does not fire
- React : TypeError: items.map is not a function
- State does not change back
- How to test the handlers in withHandlers, branch and withState of recompose with enzyme?
- React query - Why onSubmit only works after the second click
- React Hooks - function inside function component passed as prop can't access state
- make onclick inside map reactjs
- Value of this in React event handler
- How to include "refetchQueries" option into React Apollo Query with Typescript?
- google authentication pop up not working using firebase in react app
- React - How do you call a function from inside another function