我正在开发一个简单的React应用程序。我得到了错误"No routes matched location "/wear"
。我做错了什么?
App.js:
import { Routes, Route } from "react-router-dom";
import Wear from "./pages/Wear";
function Header() {
return (
<>
<li className="nav-item">
<a className="whiteNavbar nav-link active" href="/wear">
Одежда
</a>
</li>
<Routes>
<Route path="/wear " exact element={<Wear />} />
</Routes>
</>
);
}
export default Header;
Wear.js:
<div className="productTitle d-flex justify-content-between">
<div className="cardText">Толстовка з капюшоном Polar No Complies Forever</div>
<div className="cardPrice">UAH 3 600</div>
</div>
</div>
);
};
export default Wear;
1条答案
按热度按时间icnyk63a1#
请为您的路由器尝试以下结构: