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

Replace defaultProps with destructuring in function components #7145

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ggdouglas
Copy link
Contributor

@ggdouglas ggdouglas commented Jan 9, 2025

Part of React 18 Upgrade #7142

Replaces defaultProps with destructuring in anticipation of lint errors that will be encountered in React 18.3.0.

Fixes lint errors such as the following:

error: 'defaultProps' is deprecated. Use {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_valuedefault values for destructuring assignments instead} (deprecation/deprecation) at src/components/card-list/cardList.tsx:61:10:
         59 |     );
         60 | });
       > 61 | CardList.defaultProps = {
            |          ^
         62 |     bordered: true,
         63 |     compact: false,
         64 | };

See also:

@ggdouglas ggdouglas mentioned this pull request Jan 9, 2025
5 tasks
@palantir palantir deleted a comment from changelog-app bot Jan 9, 2025
@svc-palantir-github
Copy link

Replace `defaultProps` with destructuring in function components

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@svc-palantir-github
Copy link

Revert defaultProps changes to DateInput3 to fix tests

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

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