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

fix: Creates new Select component to eventually replace Dropdown #2415

Merged
merged 7 commits into from
Jun 6, 2023

Conversation

werdnanoslen
Copy link
Contributor

@werdnanoslen werdnanoslen commented May 25, 2023

Summary

USWDS 3.0 renamed Dropdown to Select. This PR duplicates the Dropdown component to a new Select component, and adds a deprecation warning to the story and component via console.warn

Related Issues or PRs

Resolves #2308
Prompts #2416

How To Test

  • Confirm Select behaves exactly the same as Dropdown
  • Open Dropdown story to see deprecation warning on page and in console

Screenshots (optional)

image Screenshot 2023-05-25 at 11 37 19

* Duplicated from dropdown
* Added a deprecation warning to the story & component via console.warn
@brandonlenz
Copy link
Contributor

Haven't tried it, but I'm wondering if you can basically just have the deprecated Dropdown be a functional component that logs a deprecation warning, then renders the Select passing all props through instead of needing a copy of all of the source code for each

@brandonlenz
Copy link
Contributor

Haven't tried it, but I'm wondering if you can basically just have the deprecated Dropdown be a functional component that logs a deprecation warning, then renders the Select passing all props through instead of needing a copy of all of the source code for each

That's actually (hopefully) a perfect use case for withDeprecationWarning!

@werdnanoslen
Copy link
Contributor Author

@brandonlenz Did I do it right?

@werdnanoslen werdnanoslen merged commit 75e9369 into main Jun 6, 2023
@werdnanoslen werdnanoslen deleted the an-select-2308 branch June 6, 2023 16:42
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.

[fix] Dropdown now called Select
3 participants