Ability to hook into Snackbar messaging
See original GitHub issueFeature Request
Describe the problem related to this feature request
I’m beginning to wonder if it would be better for me to able to hook in directly to the snackbar messages, and use my own components rather than relying on the the included snackbar.
Some issues that this would solve:
- Snackbars drawing over each other.
- Full control over what types, or even messages to show.
- Full control over styling that theme override may not be able to provide.
Describe the solution you’d like
Expose a new prop. Something along the lines of
<Dropzone onMessage ={ (message, variant) => {//Do what I want}} />
Could be called in a useEffect with message and variant dependencies.
Describe alternatives you’ve considered
The alternative is to stick with the current system, but this will always be restrictive when the user wants full control. This proposal gives advanced users the information needed, without having to overly complicate the snackbar offering.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to set up Message in Snackbar - Stack Overflow
I have a problem with Material Design Snackbar configuration. What I'm trying to achieve is to fire up Snackbar whenever there is a...
Read more >React Snackbar component - Material UI - MUI
Snackbars provide brief notifications. The component is also known as a toast. Snackbars inform users of a process that an app has performed...
Read more >Snackbar / Toast Notifications in React Tutorial - YouTube
In this video I will teach you all how to code a snackbar in reactjs.
Read more >Snackbars - Material Design
Snackbars provide brief feedback about an operation through a message at ... DoOn mobile, use up to two lines of text to communicate...
Read more >Support for displaying snackbar outside of component #30
Hey, I wanted to share a semi-complete example of how to combine the comments above to get a Typescript notistack snackbar working anywhere...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In the hooks functional component refactor I’m working on I am extracting some of this logic out, I will think how I can do this in such away that would make it amenable to be extended to this in the future.
I was thinking about having a sendInfoMessage, sendErrorMessage, send…Message functions exposed from a hook, so perhaps they could be overridden, or perhaps i should just use sendMessage(message, variant) perhaps that makes more sense. Then these could be overridden by passing in props, or defaulting to the hooks method if not passed in perhaps? Will have a think about this.
On Fri, 12 Jun 2020 at 03:22, Matthew Corner notifications@github.com wrote:
Hi @mattcorner ,
That looks great, would you like to try implementing it?