electron React产生白色

6pp0gazn  于 2022-12-08  发布在  Electron
关注(0)|答案(1)|浏览(167)

我试着在electronjs中创建一个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>
``
2w3rbyxf

2w3rbyxf1#

试一试my Electron template。或者,如果你正在寻找更小的东西,你可以try this template

相关问题