We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 184e728 commit 2b96174Copy full SHA for 2b96174
inst/www/react-tools/react-tools.js
@@ -11,9 +11,14 @@ window.reactR = (function () {
11
&& !components.hasOwnProperty(tag.name)) {
12
throw new Error("Unknown component: " + tag.name);
13
}
14
- var args = [components[tag.name], tag.attribs];
+ var elem = components.hasOwnProperty(tag.name) ? components[tag.name] : tag.name,
15
+ args = [elem, tag.attribs];
16
for (var i = 0; i < tag.children.length; i++) {
- args.push(hydrate(components, tag.children[i]));
17
+ if (typeof tag.children[i] === 'string') {
18
+ args.push(tag.children[i]);
19
+ } else {
20
+ args.push(hydrate(components, tag.children[i]));
21
+ }
22
23
return React.createElement.apply(null, args);
24
0 commit comments