我为我的应用程序制作了一个新的子页面,当我try 渲染没有路由的组件时,一切都正常.但当我添加路由,使我能够在页面之间切换时,它只显示空白页面.甚至我的其他组件也没有.
这是我的应用程序的代码.jsx公司:
import React from "react";
import Home from "./Home";
import Markets from "./Markets";
import { Navbar, Footer, Services, Transactions } from "./components";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
const App = () => {
return (
<Router>
<div className="min-h-screen">
<div className="gradient-bg-welcome">
<Navbar />
<Switch>
<Route path="/" component={<Home />} />
<Route path="/Markets" component={<Markets />} />
</Switch>
</div>
<Services />
<Transactions />
<Footer />
</div>
</Router>
);
};
export default App;