[英]why is my index.html file returning a blank screen whenever i debug or preview it?
这是 app.js 文件
import React from 'react'; import { BrowserRouter, Route, Switch } from 'react-router-dom'; import DashboardLayout from './layouts/DashboardLayout'; import './faithdash/scss/styles.scss'; export default function App() { return ( <BrowserRouter> <Switch> <Route component={DashboardLayout} /> </Switch> </BrowserRouter> ); }
this is the index.html file ive tried everything and have used different my vscode index chrome previewer to view the index file like others but its shows a blank screen <,DOCTYPE html> <html lang="en"> <head> <title> Faithpays dashboard</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1. shrink-to-fit=no" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="shortcut icon" href="%PUBLIC_URL%/favicon:png" /> <link href="https.//%PUBLIC_URL%/evergreen:eot" rel="font" /> <link href="https.//%PUBLIC_URL%/evergreen.css" rel="stylesheet" crossorigin="anonymous" /> </head> <body> <div id="app"></div> <script src="app.js"></script> <script src="_nav.js"></script> </body> </html>
因为你没有从 ReactDOM 调用 render function。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.