Skip to content

Commit c4193b6

Browse files
committed
refactor: renmaed component to element to align better with react-router-dom v6.2.1
1 parent b5cdc45 commit c4193b6

File tree

4 files changed

+47
-47
lines changed

4 files changed

+47
-47
lines changed

src/components/AppContent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ const AppContent = () => {
1212
<Routes>
1313
{routes.map((route, idx) => {
1414
return (
15-
route.component && (
15+
route.element && (
1616
<Route
1717
key={idx}
1818
path={route.path}
1919
exact={route.exact}
2020
name={route.name}
21-
element={<route.component />}
21+
element={<route.element />}
2222
/>
2323
)
2424
)

src/components/AppHeader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const AppHeader = () => {
3636
</CHeaderBrand>
3737
<CHeaderNav className="d-none d-md-flex me-auto">
3838
<CNavItem>
39-
<CNavLink to="/dashboard" component={NavLink} activeClassName="active">
39+
<CNavLink to="/dashboard" component={NavLink} activeclassname="active">
4040
Dashboard
4141
</CNavLink>
4242
</CNavItem>

src/components/AppSidebarNav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const AppSidebarNav = ({ items }) => {
2828
{...(rest.to &&
2929
!rest.items && {
3030
component: NavLink,
31-
activeClassName: 'active',
31+
activeclassname: 'active',
3232
})}
3333
key={index}
3434
{...rest}

src/routes.js

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -52,49 +52,49 @@ const Widgets = React.lazy(() => import('./views/widgets/Widgets'))
5252

5353
const routes = [
5454
{ path: '/', exact: true, name: 'Home' },
55-
{ path: '/dashboard', name: 'Dashboard', component: Dashboard },
56-
{ path: '/theme', name: 'Theme', component: Colors, exact: true },
57-
{ path: '/theme/colors', name: 'Colors', component: Colors },
58-
{ path: '/theme/typography', name: 'Typography', component: Typography },
59-
{ path: '/base', name: 'Base', component: Cards, exact: true },
60-
{ path: '/base/accordion', name: 'Accordion', component: Accordion },
61-
{ path: '/base/breadcrumbs', name: 'Breadcrumbs', component: Breadcrumbs },
62-
{ path: '/base/cards', name: 'Cards', component: Cards },
63-
{ path: '/base/carousels', name: 'Carousel', component: Carousels },
64-
{ path: '/base/collapses', name: 'Collapse', component: Collapses },
65-
{ path: '/base/list-groups', name: 'List Groups', component: ListGroups },
66-
{ path: '/base/navs', name: 'Navs', component: Navs },
67-
{ path: '/base/paginations', name: 'Paginations', component: Paginations },
68-
{ path: '/base/placeholders', name: 'Placeholders', component: Placeholders },
69-
{ path: '/base/popovers', name: 'Popovers', component: Popovers },
70-
{ path: '/base/progress', name: 'Progress', component: Progress },
71-
{ path: '/base/spinners', name: 'Spinners', component: Spinners },
72-
{ path: '/base/tables', name: 'Tables', component: Tables },
73-
{ path: '/base/tooltips', name: 'Tooltips', component: Tooltips },
74-
{ path: '/buttons', name: 'Buttons', component: Buttons, exact: true },
75-
{ path: '/buttons/buttons', name: 'Buttons', component: Buttons },
76-
{ path: '/buttons/dropdowns', name: 'Dropdowns', component: Dropdowns },
77-
{ path: '/buttons/button-groups', name: 'Button Groups', component: ButtonGroups },
78-
{ path: '/charts', name: 'Charts', component: Charts },
79-
{ path: '/forms', name: 'Forms', component: FormControl, exact: true },
80-
{ path: '/forms/form-control', name: 'Form Control', component: FormControl },
81-
{ path: '/forms/select', name: 'Select', component: Select },
82-
{ path: '/forms/checks-radios', name: 'Checks & Radios', component: ChecksRadios },
83-
{ path: '/forms/range', name: 'Range', component: Range },
84-
{ path: '/forms/input-group', name: 'Input Group', component: InputGroup },
85-
{ path: '/forms/floating-labels', name: 'Floating Labels', component: FloatingLabels },
86-
{ path: '/forms/layout', name: 'Layout', component: Layout },
87-
{ path: '/forms/validation', name: 'Validation', component: Validation },
88-
{ path: '/icons', exact: true, name: 'Icons', component: CoreUIIcons },
89-
{ path: '/icons/coreui-icons', name: 'CoreUI Icons', component: CoreUIIcons },
90-
{ path: '/icons/flags', name: 'Flags', component: Flags },
91-
{ path: '/icons/brands', name: 'Brands', component: Brands },
92-
{ path: '/notifications', name: 'Notifications', component: Alerts, exact: true },
93-
{ path: '/notifications/alerts', name: 'Alerts', component: Alerts },
94-
{ path: '/notifications/badges', name: 'Badges', component: Badges },
95-
{ path: '/notifications/modals', name: 'Modals', component: Modals },
96-
{ path: '/notifications/toasts', name: 'Toasts', component: Toasts },
97-
{ path: '/widgets', name: 'Widgets', component: Widgets },
55+
{ path: '/dashboard', name: 'Dashboard', element: Dashboard },
56+
{ path: '/theme', name: 'Theme', element: Colors, exact: true },
57+
{ path: '/theme/colors', name: 'Colors', element: Colors },
58+
{ path: '/theme/typography', name: 'Typography', element: Typography },
59+
{ path: '/base', name: 'Base', element: Cards, exact: true },
60+
{ path: '/base/accordion', name: 'Accordion', element: Accordion },
61+
{ path: '/base/breadcrumbs', name: 'Breadcrumbs', element: Breadcrumbs },
62+
{ path: '/base/cards', name: 'Cards', element: Cards },
63+
{ path: '/base/carousels', name: 'Carousel', element: Carousels },
64+
{ path: '/base/collapses', name: 'Collapse', element: Collapses },
65+
{ path: '/base/list-groups', name: 'List Groups', element: ListGroups },
66+
{ path: '/base/navs', name: 'Navs', element: Navs },
67+
{ path: '/base/paginations', name: 'Paginations', element: Paginations },
68+
{ path: '/base/placeholders', name: 'Placeholders', element: Placeholders },
69+
{ path: '/base/popovers', name: 'Popovers', element: Popovers },
70+
{ path: '/base/progress', name: 'Progress', element: Progress },
71+
{ path: '/base/spinners', name: 'Spinners', element: Spinners },
72+
{ path: '/base/tables', name: 'Tables', element: Tables },
73+
{ path: '/base/tooltips', name: 'Tooltips', element: Tooltips },
74+
{ path: '/buttons', name: 'Buttons', element: Buttons, exact: true },
75+
{ path: '/buttons/buttons', name: 'Buttons', element: Buttons },
76+
{ path: '/buttons/dropdowns', name: 'Dropdowns', element: Dropdowns },
77+
{ path: '/buttons/button-groups', name: 'Button Groups', element: ButtonGroups },
78+
{ path: '/charts', name: 'Charts', element: Charts },
79+
{ path: '/forms', name: 'Forms', element: FormControl, exact: true },
80+
{ path: '/forms/form-control', name: 'Form Control', element: FormControl },
81+
{ path: '/forms/select', name: 'Select', element: Select },
82+
{ path: '/forms/checks-radios', name: 'Checks & Radios', element: ChecksRadios },
83+
{ path: '/forms/range', name: 'Range', element: Range },
84+
{ path: '/forms/input-group', name: 'Input Group', element: InputGroup },
85+
{ path: '/forms/floating-labels', name: 'Floating Labels', element: FloatingLabels },
86+
{ path: '/forms/layout', name: 'Layout', element: Layout },
87+
{ path: '/forms/validation', name: 'Validation', element: Validation },
88+
{ path: '/icons', exact: true, name: 'Icons', element: CoreUIIcons },
89+
{ path: '/icons/coreui-icons', name: 'CoreUI Icons', element: CoreUIIcons },
90+
{ path: '/icons/flags', name: 'Flags', element: Flags },
91+
{ path: '/icons/brands', name: 'Brands', element: Brands },
92+
{ path: '/notifications', name: 'Notifications', element: Alerts, exact: true },
93+
{ path: '/notifications/alerts', name: 'Alerts', element: Alerts },
94+
{ path: '/notifications/badges', name: 'Badges', element: Badges },
95+
{ path: '/notifications/modals', name: 'Modals', element: Modals },
96+
{ path: '/notifications/toasts', name: 'Toasts', element: Toasts },
97+
{ path: '/widgets', name: 'Widgets', element: Widgets },
9898
]
9999

100100
export default routes

0 commit comments

Comments
 (0)