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

Notifications popping up in the wrong sub-window in Material Ui Dialogs #40

Open
Claim0013 opened this issue Jul 27, 2018 · 3 comments
Open

Comments

@Claim0013
Copy link

I am using Material Ui and in one particular window I have a Dialog that opens another Dialog where if something happens a notification goes off.

Now it seems as if the notification has its root in the first Dialog, which is wrong. It should be in the second Dialog.

Here's a screenshot of what this looks like.

Any help appreciated.

@Claim0013
Copy link
Author

Nevermind, solved it myself.

@CelcoNeto
Copy link

CelcoNeto commented Feb 6, 2020

How did you solve it?
I have the same problem.
@Claim0013

@Claim0013
Copy link
Author

Claim0013 commented Feb 7, 2020

How did you solve it?
I have the same problem.
@Claim0013

Hey I'm really sorry but this was so long ago - I don't remember how I solved it but I can hint you over to react-toastify. You just add that once in your index.js and then call it as toast.info/error/success in the file you want the message.

The issue you're running into may be related to importing the component itself (not the method) in multiple files so maybe look out for that.

For instance with react-toastify you only do import { ToastContainer } from 'react-toastify'; once in index.js and then just use toast.info wherever you want.

So just do import {NotificationContainer, NotificationManager} from 'react-notifications'; once in a dedicated file only for messages and import the methods from there.

Hope that helps.

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

No branches or pull requests

2 participants