react-notifications icon indicating copy to clipboard operation
react-notifications copied to clipboard

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

Open Claim0013 opened this issue 7 years ago • 3 comments

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 avatar Jul 27 '18 07:07 Claim0013

Nevermind, solved it myself.

Claim0013 avatar Jul 31 '18 07:07 Claim0013

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

CelcoNeto avatar Feb 06 '20 14:02 CelcoNeto

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.

Claim0013 avatar Feb 07 '20 07:02 Claim0013