Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closeModal() not working #157

Open
min6390 opened this issue Oct 3, 2024 · 3 comments
Open

closeModal() not working #157

min6390 opened this issue Oct 3, 2024 · 3 comments
Assignees
Labels
bug Something isn't working repro needed Reproducible demo app/Expo Snack is needed

Comments

@min6390
Copy link

min6390 commented Oct 3, 2024

The modal is stuck and cannot be closed using closeModal(), it has to be swiped to close. The only solution is to kill the app?

@CharlesMangwa CharlesMangwa self-assigned this Nov 5, 2024
@CharlesMangwa CharlesMangwa added bug Something isn't working repro needed Reproducible demo app/Expo Snack is needed labels Nov 5, 2024
@CharlesMangwa
Copy link
Member

hey @min6390 ! i'd be very helpful if you could provide a reproducible demo via snack pls.

@Grohden
Copy link

Grohden commented Dec 18, 2024

Have the same, plus this log

WARN  Excessive number of pending callbacks: 501. Some pending callbacks that might have leaked by never being called from native code: {"43327":{},"43329":{},"43331":{},"43333":{},"43335":{},"43337":{},"43339":{},"43341":{},"43343":{},"43345":{},"43347":{},"43349":{},"43351":{},"43353":{},"43355":{},"43357":{},"43359":{},"43361":{},"43363":{},"43365":{},"43367":{},"43369":{},"43371":{},"43373":{},"43375":{},"43377":{},"43379":{},"43381":{},"43383":{},"43385":{},"43387":{},"43389":{},"43391":{},"43393":{},"43395":{},"43397":{},"43399":{},"43401":{},"43403":{},"43405":{},"43407":{},"43409":{},"43411":{},"43413":{},"43415":{},"43417":{},"43419":{},"43421":{},"43423":{},"43425":{},"...(truncated keys)...":451} 
StackItem@http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.app365185:21
RCTView
View@http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.app:63701:43
Animated(View)@http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.app:80746:62
ModalStack@http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.app:365005:22
ModalProvider@http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.app:364874:24
RCTView
View@http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.app:63701:43
GestureHandlerRootView@http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=com.app:164788:21

I'll see if I can get more details

@Grohden
Copy link

Grohden commented Dec 18, 2024

Hmm.. noob mistake, I assumed modal would be stable so my specific issue is related to #132

I've made this to just test the lib

const modal = useModal();
  useEffect(() => {
    setTimeout(() => {
      modal.openModal('ConfirmModal');
    }, 1000);
  }, [modal]);

but modal is not stable so I'm getting a infinite setTimeout loop, fix is just to rely on the stable callback

const { openModal } = useModal();
  useEffect(() => {
    setTimeout(() => {
      openModal('ConfirmModal');
    }, 1000);
  }, [openModal]);

Now close works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repro needed Reproducible demo app/Expo Snack is needed
Projects
None yet
Development

No branches or pull requests

3 participants