diff --git a/core/src/components/loading/readme.md b/core/src/components/loading/readme.md index 949708ff24..5a901ff680 100644 --- a/core/src/components/loading/readme.md +++ b/core/src/components/loading/readme.md @@ -139,17 +139,23 @@ import { IonButton, IonContent, IonPage, useIonLoading } from '@ionic/react'; interface LoadingProps {} const LoadingExample: React.FC = () => { - const [present] = useIonLoading(); + const [present, dismiss] = useIonLoading(); + /** + * The recommended way of dismissing is to use the `dismiss` property + * on `IonLoading`, but the `dismiss` method returned from `useIonLoading` + * can be used for more complex scenarios. + */ return ( + onClick={() => { present({ - duration: 3000, + message: 'Loading...', + duration: 3000 }) - } + }} > Show Loading diff --git a/core/src/components/loading/usage/react.md b/core/src/components/loading/usage/react.md index b99e0d2951..a9f65cb595 100644 --- a/core/src/components/loading/usage/react.md +++ b/core/src/components/loading/usage/react.md @@ -7,17 +7,23 @@ import { IonButton, IonContent, IonPage, useIonLoading } from '@ionic/react'; interface LoadingProps {} const LoadingExample: React.FC = () => { - const [present] = useIonLoading(); + const [present, dismiss] = useIonLoading(); + /** + * The recommended way of dismissing is to use the `dismiss` property + * on `IonLoading`, but the `dismiss` method returned from `useIonLoading` + * can be used for more complex scenarios. + */ return ( + onClick={() => { present({ - duration: 3000, + message: 'Loading...', + duration: 3000 }) - } + }} > Show Loading