Comparing version 8.1.3 to 8.1.4
18
index.js
@@ -265,3 +265,7 @@ /* eslint-disable */ | ||
const instance = new Class(attr); | ||
return instance.render(); | ||
const node = instance.render(); | ||
if ("ref" in attr) { | ||
attachRef(attr.ref, instance); | ||
} | ||
return node; | ||
} | ||
@@ -627,6 +631,10 @@ | ||
const css = | ||
list | ||
.slice(0, lastIndex) | ||
.reduce((p, s, i) => p + s + interpolations[i](props), "") + | ||
list[lastIndex]; | ||
list.slice(0, lastIndex).reduce((p, s, i) => { | ||
const interpolation = interpolations[i]; | ||
const current = | ||
typeof interpolation === "function" | ||
? interpolation(props) | ||
: interpolation; | ||
return p + s + current; | ||
}, "") + list[lastIndex]; | ||
return createElement(name, { | ||
@@ -633,0 +641,0 @@ style: [css, style], |
@@ -126,3 +126,7 @@ /* eslint-disable */ | ||
const instance = new Class(attr); | ||
return instance.render(); | ||
const node = instance.render(); | ||
if ("ref" in attr) { | ||
attachRef(attr.ref, instance); | ||
} | ||
return node; | ||
} | ||
@@ -451,6 +455,10 @@ | ||
const css = | ||
list | ||
.slice(0, lastIndex) | ||
.reduce((p, s, i) => p + s + interpolations[i](props), "") + | ||
list[lastIndex]; | ||
list.slice(0, lastIndex).reduce((p, s, i) => { | ||
const interpolation = interpolations[i]; | ||
const current = | ||
typeof interpolation === "function" | ||
? interpolation(props) | ||
: interpolation; | ||
return p + s + current; | ||
}, "") + list[lastIndex]; | ||
return createElement(name, { | ||
@@ -457,0 +465,0 @@ style: [css, style], |
{ | ||
"name": "jsx-dom", | ||
"version": "8.1.3", | ||
"version": "8.1.4", | ||
"description": "JSX to document.createElement.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,3 @@ import type { FunctionComponent, JSX, StyleInput } from "./index" | ||
template: TemplateStringsArray, | ||
...interpolations: InterpolationFunction<InherentProps & AdditionalProps>[] | ||
...interpolations: (InterpolationFunction<InherentProps & AdditionalProps> | string | number)[] | ||
) => FunctionComponent<InherentProps & AdditionalProps> | ||
@@ -18,3 +18,3 @@ | ||
template: TemplateStringsArray, | ||
...interpolations: InterpolationFunction<Props>[] | ||
...interpolations: (InterpolationFunction<Props> | string | number)[] | ||
) => FunctionComponent< | ||
@@ -21,0 +21,0 @@ Omit<Props, "style"> & { |
Sorry, the diff of this file is too big to display
139798
3516