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

Set default value for type parameter in SelectProps #7014

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

Conversation

kp047i
Copy link

@kp047i kp047i commented Sep 9, 2024

Closes #6960

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting!

I'm not sure the best way to mark this as deprecated now. Perhaps using overload syntax we could mark this particular signature as deprecated

@kp047i
Copy link
Author

kp047i commented Sep 21, 2024

@snowystinger
I tried using overload syntax to deprecate only the function signatures where a type parameter is provided, but I couldn’t get it to work. Here’s my attempt: TypeScript Playground.

Could you check if my approach is correct, and let me know if there’s a better way to achieve this?

Thanks!

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I am not good enough at Typescript to figure out how to do it. I had a good google around. Thanks for also checking that out and confirming it.

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.

Type param in SelectProps<T> is not used
3 participants