-
Notifications
You must be signed in to change notification settings - Fork 36
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
Having some trouble #76
Comments
@acomito not yet, was planning to launch it with the last remaining feature added. |
Okay. If I come up with anything helpful I'll report back. Great looking package even if I can't get it working just yet! |
@acomito haha thank you. Hope you get it working soon. Feel free to ask again if you have any questions or problems. |
Tried to use this package again today but no luck. So are the steps to integrating it with a material-ui project anything more than installing from npm and calling:
Or do I need to put the I tried both ways and am not seeing anything (no error message either) |
Yes you need to call it and also put that in the react tree preferably as the root component or somewhere else in the tree. |
See this for an implemention example https://github.com/puranjayjain/react-materialui-notifications/blob/master/src/app/Main.js |
Feel free to reopen this issue if you have any problems. |
Where do have you been putting it in projects using react-router? Do you need something like redux at that point or is the object available globally? |
It's not available globally you might need to pass that reference using an event emitter pattern or something equivalent, I haven't had the chance to explore redux at the moment. |
Same problem here: i can't get notifications. I've took code( |
Hi, same problem here.. using React Router |
Same problem. No router, have on the page. Notifications are not shown. |
@tiagowippel @akashihi can you give me the link to the place in the project where it is being implemented if it is open source. |
@puranjayjain Component is defined here: https://github.com/akashihi/mdg-web-ui/blob/master/src/js/components/Notification.js and used here: https://github.com/akashihi/mdg-web-ui/blob/master/src/js/components/Main.js Notifications are issued here: https://github.com/akashihi/mdg-web-ui/blob/master/src/js/util/ApiUtils.js#L12 |
So @akashihi the problem seems to be that the show notifications is not being called in the same component the element is hoisted in. You can either move the showNotification call to Notification.js or create a ref to the notification.js's ReactMaterialUiNotifications component and trigger an action on that ref. |
@puranjayjain Well, i'm pretty new to the Js/React world. Could you please provide some intuition, how to implement that ref? Thanks in advance. |
It does not work because you have to call a setState or forceUpdate on your own, if not the notifications will not be updated |
I'm running into a few issues. Have you tested the package since upgrading to the new material-ui?
mui/material-ui#5573
The text was updated successfully, but these errors were encountered: