0👍
This doesn’t answer the f()
vs undefined
question, but how about adding || false
to have either key (name
, __name
, _componentTag
) or false
?
function getComponentName(options) {
return options.name || options.__name || options._componentTag || false;
}
Source:stackexchange.com