From 4bd3125c695f490476908bf5ddfc77228b9ae69a Mon Sep 17 00:00:00 2001 From: Conor Hawes Date: Fri, 25 Aug 2023 08:40:51 -0400 Subject: [PATCH 1/3] Fix doc links --- docs/react/navigation.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/react/navigation.md b/docs/react/navigation.md index d85676786cc..57de0c60552 100644 --- a/docs/react/navigation.md +++ b/docs/react/navigation.md @@ -56,7 +56,7 @@ You can also programmatically redirect from a Route's render method based on a c ## IonReactRouter -The `IonReactRouter` component wraps the traditional [`BrowserRouter`](https://reacttraining.com/react-router/web/api/BrowserRouter) component from React Router, and sets the app up for routing. Therefore, use `IonReactRouter` in place of `BrowserRouter`. You can pass in any props to `IonReactRouter` and they will be passed down to the underlying `BrowserRouter`. +The `IonReactRouter` component wraps the traditional [`BrowserRouter`](https://v5.reactrouter.com/web/api/BrowserRouter) component from React Router, and sets the app up for routing. Therefore, use `IonReactRouter` in place of `BrowserRouter`. You can pass in any props to `IonReactRouter` and they will be passed down to the underlying `BrowserRouter`. ## Nested Routes @@ -79,7 +79,7 @@ const DashboardPage: React.FC = () => { Here, there are a couple more routes defined to point to pages from within the dashboard portion of the app. Note, that we need to define the whole route in the path, and we can't leave off "/dashboard" even though we arrived to this page from that URL. React Router requires full paths, and relative paths are not supported. -However, we can use the [`match`](https://reacttraining.com/react-router/web/api/match) objects `url` property to provide the URL that was matched to render a component, which helps when working with nested routes: +However, we can use the [`match`](https://v5.reactrouter.com/web/api/match) objects `url` property to provide the URL that was matched to render a component, which helps when working with nested routes: ```tsx const DashboardPage: React.FC = ({ match }) => { @@ -199,7 +199,7 @@ Other components that have the `routerLink` prop are `IonButton`, `IonCard`, `Io Each of these components also have a `routerDirection` prop to explicitly set the type of page transition to use ("back", "forward", or "none"). -Outside of these components that have the `routerLink` prop, you can also use React Routers [`Link`](https://reacttraining.com/react-router/web/api/Link) component to navigate between views: +Outside of these components that have the `routerLink` prop, you can also use React Routers [`Link`](https://v5.reactrouter.com/web/api/Link) component to navigate between views: ```html User 1 @@ -207,7 +207,7 @@ Outside of these components that have the `routerLink` prop, you can also use Re We recommend using one of the above methods whenever possible for routing. The advantage to these approaches is that they both render an anchor (``)tag, which is suitable for overall app accessibility. -A programmatic option for navigation is using the [`history`](https://reacttraining.com/react-router/web/api/history) prop that React Router provides to the components it renders via routes. +A programmatic option for navigation is using the [`history`](https://v5.reactrouter.com/web/api/history) prop that React Router provides to the components it renders via routes. ```tsx = ({ match }) => { }; ``` -The [`match`](https://reacttraining.com/react-router/web/api/match) prop contains information about the matched route, including the URL params. We obtain the `id` param here and display it on the screen. +The [`match`](https://v5.reactrouter.com/web/api/match) prop contains information about the matched route, including the URL params. We obtain the `id` param here and display it on the screen. Note how we use a TypeScript interface to strongly type the props object. The interface gives us type safety and code completion inside of the component. @@ -643,7 +643,7 @@ const MyComponent: React.FC = () => { ## More Information -For more info on routing in React using React Router, check out their docs at [https://reacttraining.com/react-router/web](https://reacttraining.com/react-router/web). +For more info on routing in React using the React Router implementation that Ionic uses under the hood, check out their docs at [https://v5.reactrouter.com/web](https://v5.reactrouter.com/web). ## From the Community From 67d20f13d66daf5065c85cff4993c427350a21a8 Mon Sep 17 00:00:00 2001 From: Conor Hawes Date: Fri, 25 Aug 2023 08:41:03 -0400 Subject: [PATCH 2/3] Fix GH link --- docs/react/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react/navigation.md b/docs/react/navigation.md index 57de0c60552..fcacb344393 100644 --- a/docs/react/navigation.md +++ b/docs/react/navigation.md @@ -15,7 +15,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl'; This guide covers how routing works in an app built with Ionic and React. -`IonReactRouter` uses the popular [React Router](https://github.com/ReactTraining/react-router) library under the hood. With Ionic and React Router, you can create multi-page apps with rich page transitions. +`IonReactRouter` uses the popular [React Router](https://github.com/remix-run/react-router) library under the hood. With Ionic and React Router, you can create multi-page apps with rich page transitions. Everything you know about routing using React Router carries over into Ionic React. Let's take a look at the basics of an Ionic React app and how routing works with it. From f63522b797d10117632ae8da529dec93e5c26117 Mon Sep 17 00:00:00 2001 From: Conor Hawes Date: Fri, 25 Aug 2023 08:41:12 -0400 Subject: [PATCH 3/3] Fix typo --- docs/react/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react/navigation.md b/docs/react/navigation.md index fcacb344393..693a8fe15bc 100644 --- a/docs/react/navigation.md +++ b/docs/react/navigation.md @@ -588,7 +588,7 @@ Since `IonRouterOutlet` takes over the job in determining which routes get rende ### useIonRouter -The `useIonRouter` hook can be used for more direct control over routing in Ionic React. It allows you to pass additional metadata to Ionic, such as a custom animaton, before calling React router. +The `useIonRouter` hook can be used for more direct control over routing in Ionic React. It allows you to pass additional metadata to Ionic, such as a custom animation, before calling React Router. The `useIonRouter` hook returns a `UseIonRouterResult` which has several convenience methods for routing: