1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00

support custom-elements

This commit is contained in:
avim 2015-01-19 15:29:42 +02:00
parent 268ac0a419
commit 5015222f45
4 changed files with 6 additions and 1 deletions

View File

@ -236,6 +236,7 @@ function generateProps(node, context) {
function convertTagNameToConstructor(tagName, context) {
var isHtmlTag = _.contains(reactDOMSupport[context.options.targetVersion], tagName);
if (shouldUseCreateElement(context)) {
isHtmlTag = isHtmlTag || tagName.match(/^\w+(-\w+)$/);
return isHtmlTag ? "'" + tagName + "'" : tagName;
}
return isHtmlTag ? 'React.DOM.' + tagName : tagName;

View File

@ -0,0 +1,3 @@
<div>
<custom-element></custom-element>
</div>

View File

@ -0,0 +1 @@
<div><custom-element></custom-element></div>

View File

@ -113,7 +113,7 @@ function normalizeHtml(html) {
}
test('html tests', function (t) {
var files = ['scope.rt', 'lambda.rt', 'eval.rt', 'props.rt'];
var files = ['scope.rt', 'lambda.rt', 'eval.rt', 'props.rt','custom-element.rt'];
t.plan(files.length);
files.forEach(check);