fix(lib/react/jsx-runtime): fix typings issues
This commit is contained in:
parent
0095a3e153
commit
4edc6c3821
2 changed files with 9 additions and 7 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import type { ElementType } from 'react'
|
||||
import type { ElementType, JSX } from 'react'
|
||||
import type { AfterJSXCallback, BeforeJSXCallback, InsteadJSXCallback } from '.'
|
||||
|
||||
export const jPatches = new Map<
|
||||
ElementType | string,
|
||||
ElementType | keyof JSX.IntrinsicElements,
|
||||
[
|
||||
before?: Set<BeforeJSXCallback>,
|
||||
after?: Set<AfterJSXCallback>,
|
||||
instead?: Set<InsteadJSXCallback>,
|
||||
before?: Set<BeforeJSXCallback<any>>,
|
||||
after?: Set<AfterJSXCallback<any>>,
|
||||
instead?: Set<InsteadJSXCallback<any>>,
|
||||
]
|
||||
>()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { jPatches } from './_internal'
|
||||
import type { ElementType, Key, ReactElement } from 'react'
|
||||
import type { ElementType, JSX, Key, ReactElement } from 'react'
|
||||
import type { ReactJSXRuntime } from '..'
|
||||
|
||||
export type AnyJSXFactoryFunction = (typeof ReactJSXRuntime)['jsx' | 'jsxs']
|
||||
|
|
@ -21,7 +21,9 @@ type ElementTypeProps<E extends ElementType> = E extends ElementType<
|
|||
infer Props
|
||||
>
|
||||
? Props
|
||||
: never
|
||||
: E extends keyof JSX.IntrinsicElements
|
||||
? JSX.IntrinsicElements[E]
|
||||
: never
|
||||
|
||||
/**
|
||||
* Registers a hook to be called after a JSX element with the specified type is created.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue