8000 :bug: Fix output type definition · TomokiMiyauci/react-partial-hydration@fa87d63 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit fa87d63

Browse files
committed
🐛 Fix output type definition
1 parent d84d4ee commit fa87d63

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/Intersection.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ import { useFallback, useIntersection } from '@/hooks'
66
import type { ReactHTML, DetailedHTMLProps, HTMLAttributes } from 'react'
77

88
type IntersectionProps<T extends keyof ReactHTML> = {
9+
/** The children component */
910
children: JSX.Element
11+
/** `Intersection` component should render as */
1012
as?: T
1113
/** When DOM is not exists, fallback to children or passed component */
1214
fallback?: false | JSX.Element
1315
/** On fallback component is rendered, then fire */
1416
onFallback?: () => void
17+
/** Target used for intersection */
1518
target?: JSX.Element
1619
} & IntersectionObserverInit &
1720
DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>
@@ -37,7 +40,7 @@ const Intersection = <T extends keyof ReactHTML>({
3740
rootMargin,
3841
threshold,
3942
...props
40-
}: IntersectionProps<T>) => {
43+
}: IntersectionProps<T>): JSX.Element => {
4144
const ref = useRef<HTMLDivElement>(null)
4245
const _as = as ?? 'div'
4346
const targetWithKey = cloneElement(target, { key: 'target' })

lib/Static.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { useFallback } from '@/hooks'
55
import type { ReactHTML, DetailedHTMLProps, HTMLAttributes } from 'react'
66

77
type StaticProps<T extends keyof ReactHTML> = {
8+
/** The children component */
89
children: JSX.Element
10+
/** `Static` component should render as */
911
as?: T
1012
/** When DOM is not exists, fallback to children or passed component */
1113
fallback?: false | JSX.Element
@@ -30,7 +32,7 @@ const Static = <T extends keyof ReactHTML>({
3032
onFallback,
3133
style,
3234
...props
33-
}: StaticProps<T>) => {
35+
}: StaticProps<T>): JSX.Element => {
3436
const ref = useRef<HTMLDivElement>(null)
3537
const _as = as ?? 'div'
3638

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
"@/*": ["lib/*"]
2121
}
2222
},
23-
"include": ["lib", "tests", "_debug/main.tsx"]
23+
"include": ["lib", "tests", "_debug/main.tsx", "_debug/vite-env.d.ts"]
2424
}

0 commit comments

Comments
 (0)
0