Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ui): replace deprecated usage of defaultProps #13822

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

agilgur5
Copy link
Contributor

@agilgur5 agilgur5 commented Oct 26, 2024

Fixes some React 18 warnings noted in #13069 (comment):

react-dom.development.js:58 Warning: GraphPanel: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

Motivation

Future proofs some code that used deprecated defaultProps (and has warnings in React 18) by using JS default parameters instead

Modifications

  • GraphPanel.defaultProps.nodeSize -> defaultNodeSize const
    • can't quite seamlessly use a default parameter here as it was also used as a constant in a few places
  • KeyValueEditor.defaultProps.keyValues: {} -> keyValues = {} default parameter

Verification

- instead use default arguments

Signed-off-by: Anton Gilgur <[email protected]>
@terrytangyuan terrytangyuan merged commit 3df5183 into argoproj:main Oct 30, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants