I’m a newbie on react and my react Code is not showing in my browser its just blank what could be the problem?
An image of it
App.js file:
import React from ‘react’
const App = () => {
return (
E-commerce
)
}
export default App;
index.js file:
import React from "react";
import ReactDOM from "react";
import App from "./App";
ReactDOM.render(, document.getElementById("root"));
2
Answers
Please provide your code setup, how you are trying to code in React, and how you bootstrapped your app. If you could attach screenshots, it would be great.
From your information, I can see that you are trying to show "E-commerce" on the page. You could try wrapping that word inside a react fragment. For example,
This line doesn’t look right.
The ReactDOM should come from
react-dom
instead of `react, which means you should probably be able to get things working by updating that line toRead more here https://legacy.reactjs.org/docs/react-dom.html