Skip to content

Commit

Permalink
docs: update block codes in "Let's form the routes" section (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
corocoto authored Aug 6, 2023
1 parent 15af670 commit 4106056
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,16 @@ export default TestPage;
```tsx title=pages/index.tsx
// Or use @loadable/component, as part of the tutorial - uncritically
import { lazy } from "react";
import { Route, Switch, Redirect } from "react-router-dom";
import { Route, Routes, Navigate } from "react-router-dom";

const TestPage = lazy(() => import("./test"));

export const Routing = () => {
return (
<Switch>
<Route exact path="/" component={TestPage} />
<Redirect to="/" />
</Switch>
<Routes>
<Route path="/" element={<TestPage/>} />
<Route path="*" element={<Navigate to="/" />} />
</Routes>
);
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,16 @@ export default TestPage;
```tsx title=pages/index.tsx
// Либо использовать @loadable/component, в рамках туториала - некритично
import { lazy } from "react";
import { Route, Switch, Redirect } from "react-router-dom";
import { Route, Routes, Navigate } from "react-router-dom";

const TestPage = lazy(() => import("./test"));

export const Routing = () => {
return (
<Switch>
<Route exact path="/" component={TestPage} />
<Redirect to="/" />
</Switch>
<Routes>
<Route path="/" element={<TestPage/>} />
<Route path="*" element={<Navigate to="/" />} />
</Routes>
);
};
```
Expand Down

0 comments on commit 4106056

Please sign in to comment.