File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
en/docusaurus-plugin-content-docs/current/get-started
ru/docusaurus-plugin-content-docs/current/get-started Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff 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
258258import { lazy } from " react" ;
259- import { Route , Switch , Redirect } from " react-router-dom" ;
259+ import { Route , Routes , Navigate } from " react-router-dom" ;
260260
261261const TestPage = lazy (() => import (" ./test" ));
262262
263263export 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```
Original file line number Diff line number Diff line change @@ -256,16 +256,16 @@ export default TestPage;
256256``` tsx title=pages/index.tsx
257257// Либо использовать @loadable/component, в рамках туториала - некритично
258258import { lazy } from " react" ;
259- import { Route , Switch , Redirect } from " react-router-dom" ;
259+ import { Route , Routes , Navigate } from " react-router-dom" ;
260260
261261const TestPage = lazy (() => import (" ./test" ));
262262
263263export 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```
You can’t perform that action at this time.
0 commit comments