diff --git a/@coven/pair/README.md b/@coven/pair/README.md
index b4010f5..a1297ce 100644
--- a/@coven/pair/README.md
+++ b/@coven/pair/README.md
@@ -1,3 +1,4 @@
+
[](https://coven.to/pair)
diff --git a/@coven/pair/deno.json b/@coven/pair/deno.json
index fa46608..f279c41 100644
--- a/@coven/pair/deno.json
+++ b/@coven/pair/deno.json
@@ -1,9 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json",
- "compilerOptions": {
- "jsx": "react-jsx",
- "jsxImportSource": "preact"
- },
"exports": {
"./preact": "./preact/mod.ts",
"./react": "./react/mod.ts"
@@ -11,7 +7,7 @@
"imports": {
"@types/react": "npm:@types/react@^19.2.7",
"@types/react-dom": "npm:@types/react-dom@^19.2.3",
- "preact": "npm:preact@^10.28.0",
+ "preact": "npm:preact@^10.28.1",
"preact-render-to-string": "npm:preact-render-to-string@^6.6.4",
"react": "npm:react@^19.2.3",
"react-dom": "npm:react-dom@^19.2.3"
diff --git a/@coven/pair/preact/PairedRenderFunction.ts b/@coven/pair/preact/PairedRenderFunction.ts
index 8713d03..4288a4a 100644
--- a/@coven/pair/preact/PairedRenderFunction.ts
+++ b/@coven/pair/preact/PairedRenderFunction.ts
@@ -6,6 +6,7 @@ import type { Attributes, VNode } from "preact";
*
* @example
* ```tsx
+ * /** @jsxImportSource preact *\/
* import { createElement, Fragment } from "preact";
*
* const Example: PairedRenderFunction<() => number> = hook =>
diff --git a/@coven/pair/preact/pair.ts b/@coven/pair/preact/pair.ts
index c5844e6..8aafab3 100644
--- a/@coven/pair/preact/pair.ts
+++ b/@coven/pair/preact/pair.ts
@@ -6,6 +6,7 @@ import type { PairedComponentProperties } from "./PairedComponentProperties.ts";
*
* @example
* ```tsx
+ * /** @jsxImportSource preact *\/
* import { useState } from "preact/hooks";
*
* const useCount = (initialCount: number) => {
diff --git a/@coven/pair/preact/tests/preact.test.tsx b/@coven/pair/preact/tests/preact.test.ts
similarity index 64%
rename from @coven/pair/preact/tests/preact.test.tsx
rename to @coven/pair/preact/tests/preact.test.ts
index 54be2a9..2df5cce 100644
--- a/@coven/pair/preact/tests/preact.test.tsx
+++ b/@coven/pair/preact/tests/preact.test.ts
@@ -1,16 +1,17 @@
import { pair, type PairedComponentProperties } from "@coven/pair/preact";
import { assertStrictEquals } from "@std/assert";
import { renderToString } from "preact-render-to-string";
-import { useState } from "preact/hooks";
+import { useCallback, useState } from "preact/hooks";
+import { jsx } from "preact/jsx-runtime";
const Render = (usePairedState: typeof useState) => {
const [count, setCount] = usePairedState(0);
-
- return (
-
+ const onClick = useCallback(
+ () => setCount((currentCount) => currentCount + 1),
+ [],
);
+
+ return jsx("button", { children: count, onClick, type: "button" });
};
const Wanted = ({ children }: PairedComponentProperties) =>
@@ -24,8 +25,8 @@ Deno.test(
"Generated HTML with a prop should be the same from using `pair` or doing everything manually",
() =>
assertStrictEquals(
- renderToString({Render}),
- renderToString({Render}),
+ renderToString(jsx(PairedState, { key, children: Render })),
+ renderToString(jsx(Wanted, { key, children: Render })),
),
);
@@ -33,8 +34,8 @@ Deno.test(
"Generated HTML should be the same from using `pair` or doing everything manually",
() =>
assertStrictEquals(
- renderToString({Render}),
- renderToString({Render}),
+ renderToString(jsx(PairedState, { children: Render })),
+ renderToString(jsx(Wanted, { children: Render })),
),
);
diff --git a/@coven/pair/react/tests/react.test.tsx b/@coven/pair/react/tests/react.test.ts
similarity index 64%
rename from @coven/pair/react/tests/react.test.tsx
rename to @coven/pair/react/tests/react.test.ts
index 2b46175..012686d 100644
--- a/@coven/pair/react/tests/react.test.tsx
+++ b/@coven/pair/react/tests/react.test.ts
@@ -1,17 +1,21 @@
-/** @jsxImportSource react */
import { pair, type PairedComponentProperties } from "@coven/pair/react";
import { assertStrictEquals } from "@std/assert";
-import { useState } from "react";
+import { useCallback, useState } from "react";
import { renderToString } from "react-dom/server";
+import { jsx } from "react/jsx-runtime";
const Render = (usePairedState: typeof useState) => {
const [count, setCount] = usePairedState(0);
-
- return (
-
+ const onClick = useCallback(
+ () => setCount((currentCount) => currentCount + 1),
+ [],
);
+
+ return jsx("button", {
+ children: count,
+ onClick,
+ type: "button",
+ });
};
const Wanted = ({ children }: PairedComponentProperties) =>
@@ -25,8 +29,8 @@ Deno.test(
"Generated HTML with a prop should be the same from using `pair` or doing everything manually",
() =>
assertStrictEquals(
- renderToString({Render}),
- renderToString({Render}),
+ renderToString(jsx(PairedState, { key, children: Render })),
+ renderToString(jsx(Wanted, { key, children: Render })),
),
);
@@ -34,8 +38,8 @@ Deno.test(
"Generated HTML should be the same from using `pair` or doing everything manually",
() =>
assertStrictEquals(
- renderToString({Render}),
- renderToString({Render}),
+ renderToString(jsx(PairedState, { children: Render })),
+ renderToString(jsx(Wanted, { children: Render })),
),
);
diff --git a/@simulcast/preact/deno.json b/@simulcast/preact/deno.json
index 2146d0e..f8f1978 100644
--- a/@simulcast/preact/deno.json
+++ b/@simulcast/preact/deno.json
@@ -8,7 +8,7 @@
"imports": {
"@testing-library/preact": "npm:@testing-library/preact@^3.2.4",
"@testing-library/user-event": "npm:@testing-library/user-event@^14.6.1",
- "preact": "npm:preact@^10.28.0"
+ "preact": "npm:preact@^10.28.1"
},
"name": "@simulcast/preact",
"version": "0.8.5"