问题描述
我是react.j的新手,仍然在学习。我做了一个测试网站,并希望将其托管在Firebase上。部署应用程序时,仅呈现了index.html文件夹(背景显示,因为它是在index.html中声明的),但是src中的所有javascript文件都没有呈现。我的网站在本地运行文件,但无法进行部署。
Here is my public folder with my index.html
Here is my src folder with my index.js and other js files
这是我的index.html代码
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>React App</title>
</head>
<body
style="
text-align: center;
background-image: url('https://www.treehugger.com/thmb/7KYmuAKvOj3cDpRK47BMO8rwUDU=/768x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/__opt__aboutcom__coeus__resources__content_migration__treehugger__images__2019__08__clouds-2dcb0f4cf2934a48bd173b6474c4784c.jpg');
background-position: center;
background-repeat: no-repeat;
background-size: 100%;
background-attachment: fixed;
"
>
<div id="root"></div>
这是我的index.js代码
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import * as serviceWorker from './serviceWorker';
// import './index.css';
ReactDOM.render(
<div className="Outer">
<App />
</div>,document.getElementById('root')
);
serviceWorker.unregister();
构建中的index.html与上面显示的公用文件夹中的index.html相同。
这是现在的网站:https://weatherman-9860a.web.app/
由于我只是在学习,所以我想错过一个步骤。请帮我。谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)