question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to hook into Snackbar messaging

See original GitHub issue

Feature 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
max-carrollcommented, Jun 12, 2020

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:

Feature 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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Yuvaleros/material-ui-dropzone/issues/200, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHC7Y5AX22U7D2S3X7SCMLRWGGPDANCNFSM4N35TMMA .

1reaction
panz3rcommented, Jun 15, 2020

Hi @mattcorner ,

That looks great, would you like to try implementing it?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found