question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CRITICAL BUG: cannot dismiss IonLoading by useIonLoading hook

See original GitHub issue

Prerequisites

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:closed
  • Created a year ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ApayRuscommented, Nov 8, 2022

Hi. I have the same issue. It looks like 2 overlays appears, then 1 disappears, and another 1 still is showed.

0reactions
ionitron-bot[bot]commented, Dec 22, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found