summaryrefslogtreecommitdiff
path: root/packages/integrations/preact/src
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2023-02-13 19:50:21 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2023-02-13 19:50:21 +0000
commit6d4810b08bd74c5b4af489597ab67274fae03df5 (patch)
tree640e82188a4ad4391f1da9c9268ac65a9a46411f /packages/integrations/preact/src
parenta7f18051b118b4f263ed9093ab17ed7eec0e4fd5 (diff)
downloadastro-6d4810b08bd74c5b4af489597ab67274fae03df5.tar.gz
astro-6d4810b08bd74c5b4af489597ab67274fae03df5.tar.zst
astro-6d4810b08bd74c5b4af489597ab67274fae03df5.zip
[ci] format
Diffstat (limited to 'packages/integrations/preact/src')
-rw-r--r--packages/integrations/preact/src/client.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/integrations/preact/src/client.ts b/packages/integrations/preact/src/client.ts
index 6c7b99f76..138cb01aa 100644
--- a/packages/integrations/preact/src/client.ts
+++ b/packages/integrations/preact/src/client.ts
@@ -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';
@@ -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!,