Update App Core
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:
Родитель
2ed079d547
Коммит
563d2fd79a
|
@ -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;
|
Загрузка…
Ссылка в новой задаче