chore: document IonReactRouter usage with BrowserRouter

This commit is contained in:
Sean Perkins
2023-06-30 16:11:43 -04:00
parent 7236dabdce
commit 7d8204a0a7

View File

@@ -9,9 +9,11 @@ import { IonRouter } from './IonRouter';
* Wrapper around react-router-dom's BrowserRouter that provides a context for IonRouterOutlet.
* Ionic developers should use IonReactRouter instead of BrowserRouter when using React Router.
*/
export function IonReactRouter({ children, ...props }: PropsWithChildren<BrowserRouterProps>) {
export function IonReactRouter({ children }: PropsWithChildren<BrowserRouterProps>) {
// BrowserRouter is used so that the route state is kept in sync with the browser history.
// This reflects the current route in the URL.
return (
<BrowserRouter {...props}>
<BrowserRouter>
<IonRouter>{children}</IonRouter>
</BrowserRouter>
);