React给出一个白屏



我试图在电子js中创建一个react项目,但我得到一个白屏。我用谷歌搜索了很多方法,但我无法在屏幕上找到任何东西

这是我的index.html在公共文件夹。


<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>

here is index.js in src folder
``js
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run npm start or yarn start.
To create a production bundle, use npm run build or yarn build.
-->
</body>`
here is app.js in src folderjs
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run npm start or yarn start.
To create a production bundle, use npm run build or yarn build.
-->
</body>
``

试试我的电子模板。或者,如果你正在寻找一些更简单的东西,你可以尝试这个模板。

最新更新