Update the app core to support react routing and add initial routes to the core app so it knows how to handle various UI endpoints.
This commit is contained in:
Elliot Huffman 2022-02-03 23:01:01 -05:00
Родитель 2ed079d547
Коммит 563d2fd79a
1 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -1,14 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { PawLanding } from './components/PawLanding';
import { Home } from "./components/Home";
import { DeviceContainer } from "./components/DeviceContainer";
import { DeviceDetails } from "./components/DeviceDetails";
import { BrowserRouter, Routes, Route } from "react-router-dom";
function App() {
return (
<div className="App">
<PawLanding />
</div>
<BrowserRouter>
<div className="App">
<Routes>
<Route path="/" element={<Home />} />
<Route path="/devices" element={<DeviceContainer />} />
<Route path="/devices/:id" element={<DeviceDetails />} />
</Routes>
</div>
</BrowserRouter>
);
}
export default App;
export default App;