components: remove defaultProps from components#336
Open
mirekys wants to merge 1 commit intoinveniosoftware:masterfrom
Open
components: remove defaultProps from components#336mirekys wants to merge 1 commit intoinveniosoftware:masterfrom
mirekys wants to merge 1 commit intoinveniosoftware:masterfrom
Conversation
3ffe2e8 to
26f2d26
Compare
mirekys
commented
May 6, 2026
| label: "", | ||
| optimized: false, | ||
| children: null, | ||
| ui: null, |
Author
There was a problem hiding this comment.
@zzacharo @kpsherva this ui prop bugs me: it is not used anywhere in the AccordionField, passed straight to Accordion SUI component on line 180. Accordion however doesn't accept ui prop. I guess the intention was to spread the ui props to Accordion like:
const {
label = "",
children = null,
optimized = false,
includesPaths = [],
severityChecks = null,
...uiProps
} = this.props;
? This is the common pattern in other components...What do you think? Did I overlook something?
* React 18 deprecates defaultProps on function components, spamming the console with deprecation notices. * Replaces `defaultProps` with ES6 default param syntax across affected components. Part of: inveniosoftware/rfcs#112
26f2d26 to
699b7a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
❤️ Thank you for your contribution!
Description
defaultPropswith ES6 default parameter syntax across all function and pure class (render-only) components.defaultPropson function components and produces (lots of) deprecation warnings; class componentdefaultPropsare intentionally preserved. See here: https://github.com/facebook/react/blob/main/CHANGELOG.md#1830-april-25-2024Requires:
Part of: inveniosoftware/rfcs#112
Checklist
Frontend