CRITICAL BUG: cannot dismiss IonLoading by useIonLoading hook
See original GitHub issuePrerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
- Nightly
Current Behavior
useIonicLoading - dismissLoading doesnt work
const [showLoading, hideLoading] = useIonLoading();
Expected Behavior
useIonicLoading - dismissLoading should work
Steps to Reproduce
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonLoading, useIonLoading,useIonAlert } from '@ionic/react';
import { useEffect, useState } from 'react';
const Privacy: React.FC = () => {
const [showLoading, hideLoading] = useIonLoading();
useEffect(()=>{
showLoading({message:'Loading ...',spinner: 'circles'});
},[]);
const onPlay = async() => {
console.log('onPlay called');
hideLoading().then(()=>{
console.log('hideLoading');
},()=>{});
}
const onWaiting = () =>{
console.log('onWaiting');
}
return (
<IonPage>
<IonHeader>
<IonToolbar>
<IonTitle>Bug</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent fullscreen>
<IonHeader collapse="condense">
<IonToolbar>
<IonTitle size="large">ToDos</IonTitle>
</IonToolbar>
</IonHeader>
</IonContent>
</IonPage>
);
Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 6.20.3 (D:\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework : @ionic/react 6.3.3
Capacitor:
Capacitor CLI : 4.4.0
@capacitor/android : not installed
@capacitor/core : 4.4.0
@capacitor/ios : not installed
Utility:
cordova-res : 0.15.4
native-run : 1.7.1
System:
NodeJS : v16.13.2 (D:\Program Files\nodejs\node.exe)
npm : 8.15.1
OS : Windows 10
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
useIonLoading should return async present() and dismiss ...
I'm currently using the useIonLoading -hook to manage the loading spinners while fetching data from our API. Sometimes there occurres a bug.
Read more >CRITICAL BUG: cannot dismiss IonLoading by useIonLoading hook ...
I agree to follow the Code of Conduct. I have searched for existing issues that already report this problem, without success. Ionic Framework...
Read more >Ionic React: How to dismiss ion-loading correctly?
I'm a newbie and having some issues with dismissing ion-loading when using the React hook on Ionic React v5.6.11.
Read more >Ionic 4: "Loading Controller" dismiss() is called before present ...
I used "Ionic Loading Controller" to show a spinner until the data is retrieved then it calls "dismiss()" to dismissed it. it works...
Read more >Improvement: easier way to change months - celsomarques/ionic ...
ionic-framework CRITICAL BUG: cannot dismiss IonLoading by useIonLoading hook 9 open 🗓️ 3 days ago. ionic-framework bug: useIonLoading, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi. I have the same issue. It looks like 2 overlays appears, then 1 disappears, and another 1 still is showed.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.