Skip to content

Commit 4106056

Browse files
authored
docs: update block codes in "Let's form the routes" section (feature-sliced#608)
1 parent 15af670 commit 4106056

File tree

2 files changed

+10
-10
lines changed
  • i18n
    • en/docusaurus-plugin-content-docs/current/get-started
    • ru/docusaurus-plugin-content-docs/current/get-started

2 files changed

+10
-10
lines changed

i18n/en/docusaurus-plugin-content-docs/current/get-started/tutorial.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,16 @@ export default TestPage;
256256
```tsx title=pages/index.tsx
257257
// Or use @loadable/component, as part of the tutorial - uncritically
258258
import { lazy } from "react";
259-
import { Route, Switch, Redirect } from "react-router-dom";
259+
import { Route, Routes, Navigate } from "react-router-dom";
260260

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

263263
export const Routing = () => {
264264
return (
265-
<Switch>
266-
<Route exact path="/" component={TestPage} />
267-
<Redirect to="/" />
268-
</Switch>
265+
<Routes>
266+
<Route path="/" element={<TestPage/>} />
267+
<Route path="*" element={<Navigate to="/" />} />
268+
</Routes>
269269
);
270270
};
271271
```

i18n/ru/docusaurus-plugin-content-docs/current/get-started/tutorial.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,16 @@ export default TestPage;
256256
```tsx title=pages/index.tsx
257257
// Либо использовать @loadable/component, в рамках туториала - некритично
258258
import { lazy } from "react";
259-
import { Route, Switch, Redirect } from "react-router-dom";
259+
import { Route, Routes, Navigate } from "react-router-dom";
260260

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

263263
export const Routing = () => {
264264
return (
265-
<Switch>
266-
<Route exact path="/" component={TestPage} />
267-
<Redirect to="/" />
268-
</Switch>
265+
<Routes>
266+
<Route path="/" element={<TestPage/>} />
267+
<Route path="*" element={<Navigate to="/" />} />
268+
</Routes>
269269
);
270270
};
271271
```

0 commit comments

Comments
 (0)