mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
fix #190: allow kebab-case names containing more than one '-'
This commit is contained in:
parent
079f5da0d1
commit
dd2fbae5ec
@ -258,8 +258,9 @@ function convertTagNameToConstructor(tagName, context) {
|
||||
const targetSupport = reactNativeSupport[context.options.nativeTargetVersion];
|
||||
return _.includes(targetSupport.components, tagName) ? `${targetSupport.reactNative.name}.${tagName}` : tagName;
|
||||
}
|
||||
const isHtmlTag = _.includes(reactDOMSupport[context.options.targetVersion], tagName) || isCustomElement(tagName);
|
||||
let isHtmlTag = _.includes(reactDOMSupport[context.options.targetVersion], tagName) || isCustomElement(tagName);
|
||||
if (reactSupport.shouldUseCreateElement(context)) {
|
||||
isHtmlTag = isHtmlTag || tagName.match(/^\w+(-\w+)+$/);
|
||||
return isHtmlTag ? `'${tagName}'` : tagName;
|
||||
}
|
||||
return isHtmlTag ? `React.DOM.${tagName}` : tagName;
|
||||
|
Loading…
x
Reference in New Issue
Block a user