Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Feb 13, 2023
1 parent a7f1805 commit 6d4810b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/integrations/preact/src/client.ts
Original file line number Diff line number Diff line change
@@ -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 type { SignalLike } from './types';

Expand Down Expand Up @@ -28,13 +28,17 @@ export default (element: HTMLElement) =>
}

// eslint-disable-next-line @typescript-eslint/no-shadow
function Wrapper({ children }: { children: JSX.Element }) {
let attrs = Object.fromEntries(Array.from(element.attributes).map(attr => [attr.name, attr.value]));
function Wrapper({ children }: { children: JSX.Element }) {
let attrs = Object.fromEntries(
Array.from(element.attributes).map((attr) => [attr.name, attr.value])
);
return h(element.localName, attrs, children);
}

render(
h(Wrapper, null,
h(
Wrapper,
null,
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children)
),
element.parentNode!,
Expand Down

0 comments on commit 6d4810b

Please sign in to comment.