Skip to content

Commit 065727d

Browse files
authored
fix(router): fix routing components (#25)
1 parent 68f3260 commit 065727d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

recipes/basic/snippets/sources/App.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ const browserHistory = createBrowserHistory()
1414
1515
function App() {
1616
return (
17-
<>
1817
<ErrorHandler>
1918
<PageLoader />
2019
<Router history={browserHistory}>
2120
<Routes />
2221
</Router>
2322
</ErrorHandler>
24-
</>
2523
)
2624
}
2725

recipes/basic/snippets/sources/Routes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const SignInModule = React.lazy(() =>
1212
import(/* webpackChunkName: "${sourceDir.containers}/${modules.signIn}" */ './${sourceDir.containers}/${modules.signIn}')
1313
)
1414
15-
const DashboardModule = React.lazy(() =>
15+
const DashBoardModule = React.lazy(() =>
1616
import(/* webpackChunkName: "${sourceDir.containers}/${modules.dashboard}" */ './${sourceDir.containers}/${modules.dashboard}')
1717
)
1818
@@ -24,8 +24,8 @@ const RoutesComponent = () => {
2424
return (
2525
<Suspense fallback={<PageLoader />}>
2626
<Routes>
27-
<Route path={RoutePaths.SignIn} exact element={SignInModule} />
28-
<Route path={RoutePaths.Dashboard} element={DashboardModule} />
27+
<Route path={RoutePaths.SignIn} exact element={<SignInModule />} />
28+
<Route path={RoutePaths.DashBoard} element={<DashBoardModule />} />
2929
<Route path="*" element={<NotFoundModule />} />
3030
</Routes>
3131
</Suspense>

recipes/basic/snippets/sources/modules/NotFound/NotFound.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'
44
// Utils.
55
import { RoutePaths } from '@/utils'
66

7-
const NotFound = (props) => {
7+
const NotFound = () => {
88
const navigate = useNavigate();
99

1010
return (
@@ -18,4 +18,4 @@ const NotFound = (props) => {
1818
)
1919
}
2020

21-
export default withRouter(NotFound)
21+
export default NotFound

0 commit comments

Comments
 (0)