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

Address "Warning: Support for defaultProps will be removed from function components" #3483

Open
night-jellyfish opened this issue Mar 19, 2025 · 1 comment

Comments

@night-jellyfish
Copy link

night-jellyfish commented Mar 19, 2025

Describe the bug

Our application SCOUT uses version 12.0.0 of the design system and React version 18.3.1. When I run our tests, I see the following warning repeated for many components in the design system:

Warning: Spinner: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at Spinner (scout/client/node_modules/@cmsgov/design-system/dist/react-components/esm/Spinner/Spinner.js:12:73)

Looking at the design system repo, it looks like defaultProps is still in use. I'm wondering if this is something that is being looked at for a future version.

(We also have our own code in SCOUT using defaultProps that needs to be updated).

To Reproduce

Steps to reproduce the behavior:

  1. Start an application like SCOUT that has version 12.0.0 of the design system and React version 18.3.1.
  2. Run the tests locally
  3. Alternatively, you can see a run in Jenkins
  4. Scroll through to see the warnings in the logs

Screenshots

Can be provided in Slack.

Expected behavior

I expect to not see the warning.

Additional context

@jack-ryan-nava-pbc
Copy link
Collaborator

Thank you for raising this issue @night-jellyfish! We are in the process of upgrading to React 18.3.1 ourselves and hopefully when that happens we'll be able to address this issue directly. Thanks!

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

No branches or pull requests

2 participants