Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

Ionic React: How to dismiss ion-loading correctly?

$
0
0

I’m a newbie and having some issues with dismissing ion-loading when using the React hook on Ionic React v5.6.11.

I’ve tried the following ways so far:

const [present, dismiss] = useIonLoading();

// does NOT dismiss
const plain = () => {
present();
dismiss();
}

// does NOT dismiss
const withAwait = async () => {
await present();
await dismiss();
}

// DOES dismiss if timeout is 50 ms or more but not all the time
const withTimeout = () => {
present();
setTimeout(() => dismiss(), 50);
}
`
Please find an example project here

Any advice is much appreciated.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>