From 7bfb703e010e0b251c310856fea4728e3c6f888d Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Sun, 13 Jul 2025 00:17:28 +0700 Subject: [PATCH] fix(lib/react/jsx-runtime): init patch set when undefined --- lib/react/src/jsx-runtime/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/react/src/jsx-runtime/index.ts b/lib/react/src/jsx-runtime/index.ts index 518efd0..6c03b03 100644 --- a/lib/react/src/jsx-runtime/index.ts +++ b/lib/react/src/jsx-runtime/index.ts @@ -35,7 +35,7 @@ export function afterJSX(type: ElementType, patch: AfterJSXCallback) { if (!patches) { patches = [undefined, new Set(), undefined] jPatches.set(type, patches) - } + } else if (!patches[1]) patches[1] = new Set() const set = patches[1]! @@ -62,7 +62,7 @@ export function beforeJSX< if (!patches) { patches = [new Set(), undefined, undefined] jPatches.set(type, patches) - } + } else if (!patches[0]) patches[0] = new Set() const set = patches[0]! @@ -89,7 +89,7 @@ export function insteadJSX< if (!patches) { patches = [undefined, undefined, new Set()] jPatches.set(type, patches) - } + } else if (!patches[2]) patches[2] = new Set() const set = patches[2]!