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

How to call Snackbar from a ts/js file other than a component? #22132

Closed
xclw2000 opened this issue Aug 9, 2020 · 1 comment
Closed

How to call Snackbar from a ts/js file other than a component? #22132

xclw2000 opened this issue Aug 9, 2020 · 1 comment
Labels
component: snackbar This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists

Comments

@xclw2000
Copy link

xclw2000 commented Aug 9, 2020

I have a global request error logic in a ts/js file. If the return statusCode match some condition I want to show a Snackbar/Alert.
So the Snackbar/Alert will not delcared in any componet file,and I call Snackbar/Alert whenever and wherever I need.

for example, in a js file:
Snackbar.error('my message', duration, onClose);

You can reference the Ant Design notification

@xclw2000 xclw2000 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 9, 2020
@oliviertassinari oliviertassinari added component: snackbar This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 9, 2020
@oliviertassinari
Copy link
Member

Duplicate of #18098

@oliviertassinari oliviertassinari marked this as a duplicate of #18098 Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: snackbar This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants