fix(shims/react~jsx-runtime): dedupe unproxy code
This commit is contained in:
parent
38d5aa3833
commit
4f31ca9a91
1 changed files with 11 additions and 13 deletions
|
|
@ -5,18 +5,16 @@ import type { ElementType } from 'react'
|
|||
const { jsx: _jsx, jsxs: _jsxs, Fragment } = ReactJsxRuntime
|
||||
|
||||
const jsx = ((type, ...args) =>
|
||||
_jsx(
|
||||
isProxified(type as object)
|
||||
? (unproxify(type as object) as ElementType)
|
||||
: type,
|
||||
...args,
|
||||
)) as typeof _jsx
|
||||
const jsxs = ((type, ...args) =>
|
||||
_jsxs(
|
||||
isProxified(type as object)
|
||||
? (unproxify(type as object) as ElementType)
|
||||
: type,
|
||||
...args,
|
||||
)) as typeof _jsxs
|
||||
_jsx(unproxy(type as object), ...args)) as typeof _jsx
|
||||
|
||||
const jsxs = ((type, ...args) => {
|
||||
return _jsxs(unproxy(type as object), ...args)
|
||||
}) as typeof _jsxs
|
||||
|
||||
function unproxy(type: object): ElementType {
|
||||
return (isProxified(type)
|
||||
? unproxify(type)
|
||||
: type) as unknown as ElementType
|
||||
}
|
||||
|
||||
module.exports = { jsx, jsxs, Fragment }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue