Skip to content

Conversation

@ahmetkuslular
Copy link

  • If the variant sent does not match, the default variant usage is added

return function(props) {
var variant = props[prop] && values[props[prop]];
return variant && getThemeValue(name, props, variant);
var defaultVariant = props[prop] && values['default'];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that there is 'default' key in the variants object. In few use cases we may not be having 'default' as one of the item in the list of variants. In such case, I suggest to use the first item from the list of variants as a fallback.

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.

2 participants