Closed unindented closed 8 years ago
@unindented what about passing text
and actionText
as props?
According to the docs, the data should be passed when calling showSnackbar
. Adding them at render time doesn't seem to do anything...
The showSnackbar
method has logic around queueing notifications, activating the element, etc., so we probably wouldn't want to bypass it: https://github.com/google/material-design-lite/blob/027e05164202d938571c358565b14528d74ed792/src/snackbar/snackbar.js#L100-L126
Makes sense to me, though they could still be props but not in the DOM. I guess less is better here though, avoids invention.
@unindented once refs
are released in Preact proper, might be good for us to provide an alias for show() -> showSnackbar()
on the component.
Tru.
I realized it makes no sense to expose
Snackbar.Text
andSnackbar.Action
, as MDL always expects them to be there, and they can't have user-specified children. Users should always do:Sorry. 😓