Add generically typed options to <SegmentedControl /> #7649
+58
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6695
Checklist
Changes proposed in this pull request:
Instead of having the value of the option typed as a string, it should be a generic so that one could pass a enum for example.
Reviewers should focus on:
I did not change the documentation as the documentation still holds for this change. Maybe it should include this, i was not sure?
I would like focus on the wrapping around the forwardRef as it was a bit annoying to get the generic types to work there, the way i ended up doing it seemed to me the cleanest, but maybe there is a better way. Furthermore i added a comment that when/if this repo gets updated to React 19 then it should make it way easier as forwardRef is deprecated there.