-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
49 lines (45 loc) · 1.23 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import { FallbackProvider } from "../packages/current-page-fallback/src/index";
const Home = React.lazy(() => import("./pages/Home"));
const About = React.lazy(() => import("./pages/About"));
const Contact = React.lazy(() => import("./pages/Contact"));
// react-router-dom V6
const App = () => {
return (
<Router>
<div>
<FallbackProvider>
<Routes>
<Route path="/about" element={ <About />} />
<Route path="/contact" element={ <Contact />} />
<Route path="/" element={ <Home />} />
</Routes>
</FallbackProvider>
</div>
</Router>
);
};
// react-router-dom V5
// const App = () => {
// return (
// <Router>
// <div>
// <FallbackProvider>
// <Switch>
// <Route path="/about">
// <About />
// </Route>
// <Route path="/contact">
// <Contact />
// </Route>
// <Route path="/">
// <Home />
// </Route>
// </Switch>
// </FallbackProvider>
// </div>
// </Router>
// );
// };
export default App;