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: Made ToggleButton.Group TS compatible #3543

Merged
merged 5 commits into from
Jan 9, 2023

Conversation

gedu
Copy link
Contributor

@gedu gedu commented Dec 21, 2022

fix: Now you can use ToggleButton.Group with Union Types and Enums (default string)

Summary

Before you couldn't use Union types or enums without TS complaining about the type

type Fruits = 'watermelon' | 'strawberries' | 'apple';

ts_error_type_string

with this new change, TS will get the right type and won't complain

new_toggleButton_unionT_function

Test plan

  • Use different types, like string, enums and union types
  • Check if the IDE get the right type

@gedu gedu changed the title Made ToggleButton.Group TS compatible fix: Made ToggleButton.Group TS compatible Dec 21, 2022
@callstack-bot
Copy link

callstack-bot commented Dec 21, 2022

Hey @gedu, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@gedu gedu requested a review from lukewalczak December 21, 2022 09:27
src/components/ToggleButton/ToggleButtonGroup.tsx Outdated Show resolved Hide resolved
src/components/ToggleButton/ToggleButtonGroup.tsx Outdated Show resolved Hide resolved
src/components/ToggleButton/ToggleButtonGroup.tsx Outdated Show resolved Hide resolved
@gedu gedu requested a review from satya164 December 21, 2022 14:17
@gedu gedu requested a review from jaworek January 9, 2023 10:07
@lukewalczak lukewalczak merged commit 9273d37 into callstack:main Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants