Skip to content

prop-ype of searchableIndexes[] changed to to node#2530

Open
MikeTaylor wants to merge 2 commits intomainfrom
MikeTaylor-patch-1
Open

prop-ype of searchableIndexes[] changed to to node#2530
MikeTaylor wants to merge 2 commits intomainfrom
MikeTaylor-patch-1

Conversation

@MikeTaylor
Copy link
Copy Markdown
Contributor

When this is provided as <FormattedMessage>, a prop-types warning is emitted on the console even though this works just fine. We should get rid of the false-positive complaint.

When this is provided as `<FormattedMessage>`, a prop-types warning is emitted on the console even though this works just fine. We should get rid of the false-positive complaint.
@MikeTaylor MikeTaylor requested a review from a team as a code owner March 27, 2026 17:25
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

Bigtest Unit Test Results

    1 files  ±0      1 suites  ±0   25s ⏱️ -1s
1 623 tests ±0  1 614 ✅  - 1  8 💤 ±0  1 ❌ +1 
1 624 runs  ±0  1 615 ✅  - 1  8 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit c400e77. ± Comparison against base commit abb58d5.

This pull request removes 1623 and adds 1623 tests. Note that renamed tests count towards both.
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet contents ready for interaction following open ‑ Accordion - as part of an AccordionSet contents ready for interaction following open Child element was filled out successfully
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet keyboard navigation: first accordion ‑ Accordion - as part of an AccordionSet keyboard navigation: first accordion First accordion is in focus
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet keyboard navigation: last accordion ‑ Accordion - as part of an AccordionSet keyboard navigation: last accordion Last accordion is in focus
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet keyboard navigation: next accordion ‑ Accordion - as part of an AccordionSet keyboard navigation: next accordion second accordion is in focus
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet keyboard navigation: previous accordion ‑ Accordion - as part of an AccordionSet keyboard navigation: previous accordion first accordion is in focus
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet ‑ Accordion - as part of an AccordionSet has a button
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet ‑ Accordion - as part of an AccordionSet has no axe errors
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet ‑ Accordion - as part of an AccordionSet should call onRegisterAccordion callback
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - updating state of parent component opening the closed accordion changing the text value/parent state ‑ Accordion - updating state of parent component opening the closed accordion changing the text value/parent state renders second accordion as open
Chrome_145_0_0_0_(Linux_0_0_0).Accordion - updating state of parent component opening the closed accordion changing the text value/parent state ‑ Accordion - updating state of parent component opening the closed accordion changing the text value/parent state renders state value in textField
…
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet contents ready for interaction following open ‑ Accordion - as part of an AccordionSet contents ready for interaction following open Child element was filled out successfully
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet keyboard navigation: first accordion ‑ Accordion - as part of an AccordionSet keyboard navigation: first accordion First accordion is in focus
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet keyboard navigation: last accordion ‑ Accordion - as part of an AccordionSet keyboard navigation: last accordion Last accordion is in focus
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet keyboard navigation: next accordion ‑ Accordion - as part of an AccordionSet keyboard navigation: next accordion second accordion is in focus
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet keyboard navigation: previous accordion ‑ Accordion - as part of an AccordionSet keyboard navigation: previous accordion first accordion is in focus
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet ‑ Accordion - as part of an AccordionSet has a button
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet ‑ Accordion - as part of an AccordionSet has no axe errors
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - as part of an AccordionSet ‑ Accordion - as part of an AccordionSet should call onRegisterAccordion callback
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - updating state of parent component opening the closed accordion changing the text value/parent state ‑ Accordion - updating state of parent component opening the closed accordion changing the text value/parent state renders second accordion as open
Chrome_146_0_0_0_(Linux_0_0_0).Accordion - updating state of parent component opening the closed accordion changing the text value/parent state ‑ Accordion - updating state of parent component opening the closed accordion changing the text value/parent state renders state value in textField
…
This pull request removes 8 skipped tests and adds 8 skipped tests. Note that renamed tests count towards both.
Chrome_145_0_0_0_(Linux_0_0_0).Datepicker defaultOutputFormatter converts non-Latn input to Latn-output ‑ Datepicker defaultOutputFormatter converts non-Latn input to Latn-output returns a Latn (Arabic, 0-9) string
Chrome_145_0_0_0_(Linux_0_0_0).Datepicker with Redux Form integration exclude prop selecting excluded date navigation on excluded date ‑ Datepicker with Redux Form integration exclude prop selecting excluded date navigation on excluded date changed cursor to April 2, 2018
Chrome_145_0_0_0_(Linux_0_0_0).Editor rendering a basic Editor ‑ Editor rendering a basic Editor has no axe errors. - Editor
Chrome_145_0_0_0_(Linux_0_0_0).Popover If the legacy component API is used When the toggle is clicked again ‑ Popover If the legacy component API is used When the toggle is clicked again Hides the popover overlay
Chrome_145_0_0_0_(Linux_0_0_0).Popover If the legacy component API is used ‑ Popover If the legacy component API is used Renders the legacy popover and opens the overlay when the toggle is clicked
Chrome_145_0_0_0_(Linux_0_0_0).childrenOf propType validator Passing a type that isn't allowed ‑ childrenOf propType validator Passing a type that isn't allowed triggers a propType error
Chrome_145_0_0_0_(Linux_0_0_0).childrenOf propType validator Passing a type that isn't allowed ‑ childrenOf propType validator Passing a type that isn't allowed triggers no proptype error
Chrome_145_0_0_0_(Linux_0_0_0).childrenOf propType validator not providing a required prop ‑ childrenOf propType validator not providing a required prop triggers a required propType error
Chrome_146_0_0_0_(Linux_0_0_0).Datepicker defaultOutputFormatter converts non-Latn input to Latn-output ‑ Datepicker defaultOutputFormatter converts non-Latn input to Latn-output returns a Latn (Arabic, 0-9) string
Chrome_146_0_0_0_(Linux_0_0_0).Datepicker with Redux Form integration exclude prop selecting excluded date navigation on excluded date ‑ Datepicker with Redux Form integration exclude prop selecting excluded date navigation on excluded date changed cursor to April 2, 2018
Chrome_146_0_0_0_(Linux_0_0_0).Editor rendering a basic Editor ‑ Editor rendering a basic Editor has no axe errors. - Editor
Chrome_146_0_0_0_(Linux_0_0_0).Popover If the legacy component API is used When the toggle is clicked again ‑ Popover If the legacy component API is used When the toggle is clicked again Hides the popover overlay
Chrome_146_0_0_0_(Linux_0_0_0).Popover If the legacy component API is used ‑ Popover If the legacy component API is used Renders the legacy popover and opens the overlay when the toggle is clicked
Chrome_146_0_0_0_(Linux_0_0_0).childrenOf propType validator Passing a type that isn't allowed ‑ childrenOf propType validator Passing a type that isn't allowed triggers a propType error
Chrome_146_0_0_0_(Linux_0_0_0).childrenOf propType validator Passing a type that isn't allowed ‑ childrenOf propType validator Passing a type that isn't allowed triggers no proptype error
Chrome_146_0_0_0_(Linux_0_0_0).childrenOf propType validator not providing a required prop ‑ childrenOf propType validator not providing a required prop triggers a required propType error

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

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

string is the wrong thing for the <FormattedMessage> reason you identified, but I think the right thing is node. Moving to any just trades the prop-types warning for a lint warning since lint does not like any.

That said, lint is totally hosed in this repo, and I'm fine accepting this as a bug-fix even if it's questionable as an improvement. So, ultimately, your call.

@MikeTaylor
Copy link
Copy Markdown
Contributor Author

But a string is acceptable, so I don't think node would be right, either. We could pedantically use oneOfType to allow either, but at that point, I think we might as well just shrug and admit that it's actually any.

Happy to hear @JohnC-80's thoughts.

@zburke
Copy link
Copy Markdown
Member

zburke commented Mar 27, 2026

I stand by node. From the docs:

  // Anything that can be rendered: numbers, strings, elements or an array
  // (or fragment) containing these types.
  // see https://reactjs.org/docs/rendering-elements.html for more info
  optionalNode: PropTypes.node,

  // A React element (ie. <MyComponent />).
  optionalElement: PropTypes.element,

searchableIndexes gets fed through <Select> in dataOptions, which is unhelpfully

PropTypes.arrayOf(PropTypes.object),

in the code, though documentation says those array entries should match

{ value: <string>, label: <string>, disabled: <bool> }

perpetuating the same error you're correcting here.

@MikeTaylor
Copy link
Copy Markdown
Contributor Author

Ooo, node is better than I realised! Yes, let's do that.

@MikeTaylor MikeTaylor changed the title prop-ype of searchableIndexes[] changed to to any prop-ype of searchableIndexes[] changed to to node Mar 27, 2026
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants