From 4f085f19953dd8259dfc907cca10a2dfb265d722 Mon Sep 17 00:00:00 2001 From: jdecroock Date: Thu, 11 Apr 2024 11:06:33 +0200 Subject: [PATCH] shave --- jsx-runtime/src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jsx-runtime/src/index.js b/jsx-runtime/src/index.js index f6e1b13101..f4994ef5d3 100644 --- a/jsx-runtime/src/index.js +++ b/jsx-runtime/src/index.js @@ -27,13 +27,14 @@ const isArray = Array.isArray; * @param {unknown} [__self] */ function createVNode(type, props, key, isStaticChildren, __source, __self) { + if (!props) props = {}; // We'll want to preserve `ref` in props to get rid of the need for // forwardRef components in the future, but that should happen via // a separate PR. - let normalizedProps = props || {}, + let normalizedProps = props, ref, i; - if (normalizedProps && (ref = normalizedProps.ref)) { + if ((ref = normalizedProps.ref)) { normalizedProps = {}; for (i in props) { if (i != 'ref') {