[ci] format
This commit is contained in:
parent
a7f18051b1
commit
6d4810b08b
1 changed files with 9 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { h, type JSX, render } from 'preact';
|
import { h, render, type JSX } from 'preact';
|
||||||
import StaticHtml from './static-html.js';
|
import StaticHtml from './static-html.js';
|
||||||
import type { SignalLike } from './types';
|
import type { SignalLike } from './types';
|
||||||
|
|
||||||
|
@ -28,13 +28,17 @@ export default (element: HTMLElement) =>
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||||
function Wrapper({ children }: { children: JSX.Element }) {
|
function Wrapper({ children }: { children: JSX.Element }) {
|
||||||
let attrs = Object.fromEntries(Array.from(element.attributes).map(attr => [attr.name, attr.value]));
|
let attrs = Object.fromEntries(
|
||||||
|
Array.from(element.attributes).map((attr) => [attr.name, attr.value])
|
||||||
|
);
|
||||||
return h(element.localName, attrs, children);
|
return h(element.localName, attrs, children);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(
|
render(
|
||||||
h(Wrapper, null,
|
h(
|
||||||
|
Wrapper,
|
||||||
|
null,
|
||||||
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children)
|
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children)
|
||||||
),
|
),
|
||||||
element.parentNode!,
|
element.parentNode!,
|
||||||
|
|
Loading…
Reference in a new issue