-
Notifications
You must be signed in to change notification settings - Fork 0
/
router.js
143 lines (141 loc) · 3.25 KB
/
router.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import React, { Suspense, lazy } from "react";
import { createBrowserRouter } from "react-router-dom";
import Home from "./src/pages/Home";
import Counter from "./src/pages/Counter";
import CounterReducer from "./src/pages/CounterReducer";
import ToDoReducer from "./src/pages/ToDoReducer";
import UseRef from "./src/pages/hooks/UseRef";
import Props from "./src/pages/props/Props";
import ClassComponent from "./src/pages/ClassComponent";
import SetStateComponent from "./src/pages/SetStateComponent";
import ControlledInput from "./src/pages/ControlledInput";
import LifeCycle from "./src/pages/LifeCycye";
import ReduxCounter from "./src/pages/redux/ReduxCounter";
import CountrySelector from "./src/pages/CountrySelector";
import VirtualDOM from "./src/pages/VirtualDOM";
import ImportExport from "./src/pages/ImportExport";
import UseState from "./src/pages/hooks/useState";
import Hooks from "./src/pages/hooks/Hooks";
import UseMemo from "./src/pages/hooks/UseMemo";
import UseCallback from "./src/pages/hooks/UseCallback";
import ChildProps from "./src/pages/child_props/ChildProps";
import Portal from "./src/pages/Portal";
import Todo from "./src/pages/todo/Todo";
import UseEffect from "./src/pages/hooks/UseEffect";
import ReactContext from "./src/pages/react_context/ReactContext";
import HigherOrderComponent from "./src/pages/higher_order/HigherOrderComponent";
import Timer from "./src/pages/Timer";
const Lazycomp = lazy(() => import("./src/pages/LazyComponent"));
export const router = createBrowserRouter([
{
path: "/",
element: <Home />,
},
{
path: "/counter",
element: <Counter />,
},
{
path: "/counter2",
element: <CounterReducer />,
},
{
path: "/todo",
element: <ToDoReducer />,
},
{
path: "/callback",
element: <UseState />,
},
{
path: "/useRef",
element: <UseRef />,
},
{
path: "/props",
element: <Props />,
},
{
path: "/classComponent",
element: <ClassComponent />,
children: [{ path: "setState", element: <SetStateComponent /> }],
},
{
path: "/controlledInput",
element: <ControlledInput />,
},
{
path: "/lifecycle",
element: <LifeCycle />,
},
{
path: "/reduxcounter",
element: <ReduxCounter />,
},
{
path: "/countryselector",
element: <CountrySelector />,
},
{
path: "/virtualdom",
element: <VirtualDOM />,
},
{
path: "/importexport",
element: <ImportExport />,
},
{
path: "/childprops",
element: <ChildProps />,
},
{
path: "/portal",
element: <Portal />,
},
{
path: "/todoapp",
element: <Todo />,
},
{
path: "/reactcontext",
element: <ReactContext />,
},
{
path: "/hocomponent",
element: <HigherOrderComponent />,
},
{
path: "/timer",
element: <Timer />,
},
{
path: "/lazycomponent",
element: (
<Suspense>
<Lazycomp />
</Suspense>
),
},
{
path: "/hooks",
element: <Hooks />,
children: [
{
path: "usememo",
element: <UseMemo />,
},
{
path: "usecallback",
element: <UseCallback />,
},
{
path: "useref",
element: <UseRef />,
},
{
path: "useeffect",
element: <UseEffect />,
},
],
},
]);