diff --git a/core/src/components/modal/readme.md b/core/src/components/modal/readme.md
index 2203c9f5fa..37d8fd30e0 100644
--- a/core/src/components/modal/readme.md
+++ b/core/src/components/modal/readme.md
@@ -353,18 +353,48 @@ Modals in iOS mode have the ability to be presented in a card-style and swiped t
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
```tsx
- setShowModal(false)}>
- This is modal content
- setShowModal(false)}>Close Modal
-
+const App: React.FC = () => {
+ const routerRef = useRef(null);
+
+ return (
+
+
+
+ } exact={true} />
+
+
+
+ )
+};
+
+...
+
+interface HomePageProps {
+ router: HTMLIonRouterOutletElement | null;
+}
+
+const Home: React.FC = ({ router }) => {
+ const [showModal, setShowModal] = useState(false);
+
+ return (
+ ...
+
+ setShowModal(false)}>
+ This is modal content
+
+
+ ...
+ );
+};
+
```
-In most scenarios, setting a ref on `IonPage` and passing that ref's `current` value to `presentingElement` is fine. In cases where you are presenting a card-style modal from within another modal, you should pass in the top-most `ion-modal` ref as the `presentingElement`.
+In most scenarios, setting a ref on `IonRouterOutlet` and passing that ref's `current` value to `presentingElement` is fine. In cases where you are presenting a card-style modal from within another modal, you should pass in the top-most `ion-modal` ref as the `presentingElement`.
```tsx
setShowModal(false)}>
This is modal content
setShow2ndModal(true)}>Show 2nd Modal
diff --git a/core/src/components/modal/usage/react.md b/core/src/components/modal/usage/react.md
index e3cfe2c9e3..c46544e760 100644
--- a/core/src/components/modal/usage/react.md
+++ b/core/src/components/modal/usage/react.md
@@ -24,18 +24,48 @@ Modals in iOS mode have the ability to be presented in a card-style and swiped t
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
```tsx
- setShowModal(false)}>
- This is modal content
- setShowModal(false)}>Close Modal
-
+const App: React.FC = () => {
+ const routerRef = useRef(null);
+
+ return (
+
+
+
+ } exact={true} />
+
+
+
+ )
+};
+
+...
+
+interface HomePageProps {
+ router: HTMLIonRouterOutletElement | null;
+}
+
+const Home: React.FC = ({ router }) => {
+ const [showModal, setShowModal] = useState(false);
+
+ return (
+ ...
+
+ setShowModal(false)}>
+ This is modal content
+
+
+ ...
+ );
+};
+
```
-In most scenarios, setting a ref on `IonPage` and passing that ref's `current` value to `presentingElement` is fine. In cases where you are presenting a card-style modal from within another modal, you should pass in the top-most `ion-modal` ref as the `presentingElement`.
+In most scenarios, setting a ref on `IonRouterOutlet` and passing that ref's `current` value to `presentingElement` is fine. In cases where you are presenting a card-style modal from within another modal, you should pass in the top-most `ion-modal` ref as the `presentingElement`.
```tsx
setShowModal(false)}>
This is modal content
setShow2ndModal(true)}>Show 2nd Modal