Skip to content

docs: remove stale parentType param from validateChildKeys JSDoc#36928

Merged
hoxyq merged 1 commit into
react:mainfrom
anxkhn:docs/remove-stale-validatechildkeys-jsdoc-param
Jul 6, 2026
Merged

docs: remove stale parentType param from validateChildKeys JSDoc#36928
hoxyq merged 1 commit into
react:mainfrom
anxkhn:docs/remove-stale-validatechildkeys-jsdoc-param

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

validateChildKeys in packages/react/src/jsx/ReactJSXElement.js had a signature
of validateChildKeys(node, parentType), but #34174 ("Remove unused arguments from
ReactElement") dropped the second argument, changing the signature to
validateChildKeys(node) and updating every call site to pass a single argument.

That change removed several now-unused @param lines from the same file, but left
one behind on validateChildKeys:

/**
 * ...
 * @internal
 * @param {ReactNode} node Statically passed child of any type.
 * @param {*} parentType node's parent's type.   // <- no such parameter anymore
 */
function validateChildKeys(node) {

parentType no longer appears anywhere in the function signature or body, so this
@param line is stale and misleading to anyone reading the doc comment. This PR
deletes that single line. The remaining @param {ReactNode} node already fully and
correctly documents the sole parameter. No code or behavior change.

How did you test this change?

This is a documentation-only change (a JSDoc comment on an @internal helper), so
there is no runtime behavior to test. I verified it as follows:

  • Confirmed parentType no longer appears anywhere in
    packages/react/src/jsx/ReactJSXElement.js (grep -n parentType returns no
    matches after the change).
  • Confirmed the signature function validateChildKeys(node) and all call sites are
    unchanged by this diff.
  • yarn prettier (via scripts/prettier/index.js check-changed) - clean.
  • yarn linc (ESLint on changed files) - passed.
  • yarn flow dom-node - No errors.

Diff (for reference)

diff --git a/packages/react/src/jsx/ReactJSXElement.js b/packages/react/src/jsx/ReactJSXElement.js
@@ -860,7 +860,6 @@ export function cloneElement(element, config, children) {
   *
   * @internal
   * @param {ReactNode} node Statically passed child of any type.
- * @param {*} parentType node's parent's type.
   */
 function validateChildKeys(node) {

PR react#34174 removed the second argument from validateChildKeys, changing
the signature from validateChildKeys(node, parentType) to
validateChildKeys(node), but left the @param {*} parentType line in the
function's JSDoc. Drop that stale line so the doc matches the single
remaining parameter.
@meta-cla

meta-cla Bot commented Jul 5, 2026

Copy link
Copy Markdown

Hi @anxkhn!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@meta-cla

meta-cla Bot commented Jul 5, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed label Jul 5, 2026

@daltino daltino left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR removes a stale parentType parameter from the JSDoc for validateChildKeys, aligning the documentation with the current function signature. The change is simple and improves clarity, with no functional impact.

@react-sizebot

Copy link
Copy Markdown

Comparing: e71a639...719157b

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 7.19 kB 7.19 kB +0.05% 1.91 kB 1.91 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 614.43 kB 614.43 kB = 108.59 kB 108.59 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 7.19 kB 7.19 kB +0.05% 1.91 kB 1.91 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 685.61 kB 685.61 kB = 120.08 kB 120.08 kB
facebook-www/ReactDOM-prod.classic.js = 705.96 kB 705.96 kB = 123.67 kB 123.67 kB
facebook-www/ReactDOM-prod.modern.js = 696.28 kB 696.28 kB = 122.05 kB 122.05 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 719157b

@hoxyq
hoxyq merged commit 4f93894 into react:main Jul 6, 2026
244 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants