fix(lib/react/jsx-runtime): fix typings issues

This commit is contained in:
PalmDevs 2025-07-16 20:05:20 +07:00
parent 0095a3e153
commit 4edc6c3821
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
2 changed files with 9 additions and 7 deletions

View file

@ -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>>,
]
>()

View file

@ -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.