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

Add PolymorphicComponentProps #277

Merged
merged 7 commits into from
Feb 16, 2024
Merged

Add PolymorphicComponentProps #277

merged 7 commits into from
Feb 16, 2024

Conversation

nswaldman
Copy link
Contributor

Adds a collection of generic types to help create strongly typed Polymorphic Components.

This came up while creating a Polymorphic component(which was easy) and then having to define types without knowing in advance which element was going to be the basis (which was a hassle). These types should make the process less of a chore.

@nswaldman nswaldman added the enhancement New feature or request label Dec 1, 2023
@nswaldman
Copy link
Contributor Author

I'm not extremely seasoned in writing tests for this particular kind of utility, but I would hazard that we'd need to test:

  1. Compare two examples of a Polymorphic Component's types using a different as value and find them not equal.
  2. Use invalid props for a given as and have it fail.

Input would be most appreciated.

@nswaldman nswaldman added the help wanted Extra attention is needed label Dec 1, 2023
@ThaNarie
Copy link
Member

ThaNarie commented Dec 1, 2023

@mmnathan Could you check / maybe help with adding type tests? :)

@leroykorterink leroykorterink requested a review from a team December 1, 2023 17:05
@leroykorterink leroykorterink merged commit 98bbbb9 into main Feb 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants