Commit 95436ea 1 parent 99c4754 commit 95436ea Copy full SHA for 95436ea
File tree 5 files changed +43
-7
lines changed
5 files changed +43
-7
lines changed Original file line number Diff line number Diff line change 7
7
8
8
jobs :
9
9
publish :
10
- runs-on : ubuntu -latest
10
+ runs-on : macos -latest
11
11
permissions :
12
12
contents : read
13
13
id-token : write
Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ Currently supported frameworks:
19
19
### Preact
20
20
21
21
``` tsx
22
- import { createElement } from " preact" ;
23
- import { useState } from " preact/hooks" ;
22
+ /** @jsxImportSource preact */
24
23
import { pair } from " @coven/pair/preact" ;
24
+ import { useState } from " preact/hooks" ;
25
25
26
26
const useCount = (initialCount : number ) => {
27
27
const [count, setCount] = useState (initialCount );
@@ -53,9 +53,11 @@ const Component = ({ array = [] }) => (
53
53
### React
54
54
55
55
``` tsx
56
- // @deno-types="@types/ react"
57
- import { createElement , useState } from " react" ;
56
+ /** @jsxImportSource react */
57
+ /** @jsxImportSourceTypes @types/ react */
58
58
import { pair } from " @coven/pair/react" ;
59
+ // @deno-types="@types/react"
60
+ import { useState } from " react" ;
59
61
60
62
const useCount = (initialCount : number ) => {
61
63
const [count, setCount] = useState (initialCount );
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import type { PairedComponentProperties } from "./PairedComponentProperties.ts";
6
6
*
7
7
* @example
8
8
* ```tsx
9
- * import { createElement } from " preact";
9
+ * /** @jsxImportSource preact *\/
10
10
* import { useState } from "preact/hooks";
11
11
*
12
12
* const useCount = (initialCount: number) => {
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ import type { PairedComponentProperties } from "./PairedComponentProperties.ts";
8
8
*
9
9
* @example
10
10
* ```tsx
11
- * import { createElement, useState } from "react";
11
+ * /** @jsxImportSource react *\/
12
+ * /** @jsxImportSourceTypes @types /react *\/
13
+ * // @deno -types="@types/react"
14
+ * import { useState } from "react";
12
15
*
13
16
* const useCount = (initialCount: number) => {
14
17
* const [count, setCount] = useState(initialCount);
Original file line number Diff line number Diff line change
1
+ /** @jsxImportSource react */
2
+ /** @jsxImportSourceTypes @types /react */
3
+ import { pair } from "@coven/pair/react" ;
4
+ // @deno -types="@types/react"
5
+ import { useState } from "react" ;
6
+
7
+ const useCount = ( initialCount : number ) => {
8
+ const [ count , setCount ] = useState ( initialCount ) ;
9
+
10
+ return { onClick : ( ) => setCount ( count + 1 ) , children : count } ;
11
+ } ;
12
+
13
+ const PairedCount = pair ( useCount ) ;
14
+
15
+ const Component = ( { array = [ ] } ) => (
16
+ < ul >
17
+ { array . map ( ( key ) => (
18
+ < PairedCount key = { key } >
19
+ { ( usePairedCount ) => {
20
+ const props = usePairedCount ( key ) ;
21
+
22
+ return (
23
+ < li >
24
+ < button type = "button" { ...props } />
25
+ </ li >
26
+ ) ;
27
+ } }
28
+ </ PairedCount >
29
+ ) ) }
30
+ </ ul >
31
+ ) ;
You can’t perform that action at this time.
0 commit comments