From 58c4fcef2b21cb7f1e6bd939228304170392348d Mon Sep 17 00:00:00 2001 From: Xiao-Gui123 <107522134+Xiao-Gui123@users.noreply.github.com> Date: Mon, 14 Jul 2025 15:21:27 +0800 Subject: [PATCH] Update ReactJSXElement.js fix: correct comment about reserved props in jsxProd function The comment incorrectly stated that key, prop, and ref are removed, but jsxProd only removes 'key' since 'ref' is passed as a separate argument in the new JSX transform. --- packages/react/src/jsx/ReactJSXElement.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/jsx/ReactJSXElement.js b/packages/react/src/jsx/ReactJSXElement.js index 6a562ba5e8578..5ef0f4fca2eb9 100644 --- a/packages/react/src/jsx/ReactJSXElement.js +++ b/packages/react/src/jsx/ReactJSXElement.js @@ -336,7 +336,7 @@ export function jsxProd(type, config, maybeKey) { // always pass the object straight through. props = config; } else { - // We need to remove reserved props (key, prop, ref). Create a fresh props + // We need to remove reserved props key. Create a fresh props // object and copy over all the non-reserved props. We don't use `delete` // because in V8 it will deopt the object to dictionary mode. props = {}; @@ -571,7 +571,7 @@ function jsxDEVImpl( // always pass the object straight through. props = config; } else { - // We need to remove reserved props (key, prop, ref). Create a fresh props + // We need to remove reserved props key. Create a fresh props // object and copy over all the non-reserved props. We don't use `delete` // because in V8 it will deopt the object to dictionary mode. props = {};