fix(shims/react~jsx-runtime): correctly unproxify values
This commit is contained in:
parent
47e10b3be0
commit
3818ee1313
1 changed files with 3 additions and 3 deletions
|
|
@ -1,13 +1,13 @@
|
|||
import { ReactJsxRuntime } from '@revenge-mod/react'
|
||||
import { getProxyTarget, isProxy } from '@revenge-mod/utils/proxy'
|
||||
import { isProxified, unproxify } from '@revenge-mod/utils/proxy'
|
||||
|
||||
import type { ElementType } from 'react'
|
||||
|
||||
const { jsx: _jsx, jsxs: _jsxs, Fragment } = ReactJsxRuntime
|
||||
|
||||
const jsx = ((type, ...args) =>
|
||||
_jsx(isProxy(type as object) ? (getProxyTarget(type as object) as ElementType) : type, ...args)) as typeof _jsx
|
||||
_jsx(isProxified(type as object) ? (unproxify(type as object) as ElementType) : type, ...args)) as typeof _jsx
|
||||
const jsxs = ((type, ...args) =>
|
||||
_jsxs(isProxy(type as object) ? (getProxyTarget(type as object) as ElementType) : type, ...args)) as typeof _jsxs
|
||||
_jsxs(isProxified(type as object) ? (unproxify(type as object) as ElementType) : type, ...args)) as typeof _jsxs
|
||||
|
||||
export { jsx, jsxs, Fragment }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue