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

Allow enqueueSnackbar children to be a function and pass the snack key #114

Merged
merged 1 commit into from
Apr 27, 2019

Conversation

jgodi
Copy link
Contributor

@jgodi jgodi commented Apr 26, 2019

We have a lot of custom, fancy snack messages that we need to be disabled in our application. These messages also have dismiss actions inside of them. The children property needs to pass the key to it, so that we can properly close the message.

This PR checks to see if the children property is a function and then will invoke that function passing the key property in. Existing functionality is still in tact, this just further enhances the customization.

Thank you,
Joshua

@rsrinivasan15
Copy link

+1

@iamhosseindhv
Copy link
Owner

Love the PR @jgodi. Can you also provide a sandbox with customised snackbars to go in the docs website for this feature?

@jgodi
Copy link
Contributor Author

jgodi commented Apr 27, 2019

Yes, where is the docs site?

@iamhosseindhv
Copy link
Owner

It's not open sourced. You can provide a sandbox link here and I'll add it to the docs website. @jgodi

@jgodi
Copy link
Contributor Author

jgodi commented Apr 27, 2019

Ok, sounds good. I will work on that now.

@jgodi
Copy link
Contributor Author

jgodi commented Apr 27, 2019

@iamhosseindhv Done. Here is the link: https://codesandbox.io/embed/y7kq6441jj

BTW. Love the library. Keep up the great work!

@iamhosseindhv iamhosseindhv merged commit fa231cc into iamhosseindhv:master Apr 27, 2019
@iamhosseindhv
Copy link
Owner

Nice one @jgodi ❤️

@iamhosseindhv
Copy link
Owner

Feature has been published

@jgodi
Copy link
Contributor Author

jgodi commented Apr 27, 2019

Thank you!

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

Successfully merging this pull request may close these issues.

3 participants