Repository navigation
Commit 4f93894
authored
docs: remove stale parentType param from validateChildKeys JSDoc (#36928)
`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`:
```js
/**
* ...
* @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
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) {
```1 parent aa43b0f commit 4f93894
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
863 | | - | |
864 | 863 | | |
865 | 864 | | |
866 | 865 | | |
| |||
0 commit comments