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

Accessing toast instance outside of component #2660

Open
ngcvm opened this issue Jan 3, 2025 · 0 comments
Open

Accessing toast instance outside of component #2660

ngcvm opened this issue Jan 3, 2025 · 0 comments
Assignees

Comments

@ngcvm
Copy link

ngcvm commented Jan 3, 2025

Description

Hi, I have migrated from NativeBase to Gluestack V2 recently and really impressed on it. But currently, when migrating the Toast, I realize that I cannot access the toast instance directly without using the hook. So my question request is to expose a function to get the toast instance, it should be a singleton instance across the app lifecycle.

Problem Statement

My app currently first some toasts inside of the axios interceptors and I want to keep these calls.

Proposed Solution or API

Expose a helper function to get the toast instance: getToastInstance(): { show, close, closeAll, ... }.

Alternatives

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants