SnackBarOrigin naming and optional modifier #12072
Labels
component: snackbar
This is the name of the generic UI component, not the React module!
good first issue
Great for first contributions. Enable to learn the contribution process.
typescript
First of all, I would rename
SnackBarOrigin
toSnackbarOrigin
, so it's in line with all otherSnackbar
namings.Secondly,
SnackBarOrigin
is defined like thiswhich indicates that you can define either of them, right? But when you only define
horizontal
for example,function capitalize(string) {
will be called for bothhorizontal
andvertical
. Sincevertical
hasn't been defined, it's undefined, ergo not a string and the errorMaterial-UI: capitalize(string) expects a string argument.
is thrown. To fix this, you have to pass bothhorizontal
andvertical
as an option.My suggestion (in addition to the naming) would be to make both of them mandatory, e.g. define it like this
or don't call
capitzlize
forundefined
strings.Your Environment
The text was updated successfully, but these errors were encountered: