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

[Checkbox] export type CheckedState #2968

Closed
wants to merge 1 commit into from

Conversation

bdsqqq
Copy link

@bdsqqq bdsqqq commented Jun 21, 2024

Description

Adds back the export for the type CheckedState, it was exported in 1.0.* and used by some to make typesafe APIs that interact with Checkbox. But this export was removed in 1.1, now consumers need a type like: type CheckedState = Parameters<NonNullable<CheckboxProps['onCheckedChange']>>[0] to keep their APIs in sync with the Radix internal types.

@rczobor
Copy link
Contributor

rczobor commented Jun 26, 2024

Could you add this type export to index.ts as well?

Also I think you'll have to run yarn version check --interactive, and then add patch version for checkbox.

@vladmoroz
Copy link
Collaborator

Surprised it actually worked before—I'm sure we never exported this type explicitly... In 1.1 there was a bundler change that might have affected the exports.

@coffe4u
Copy link

coffe4u commented Jun 27, 2024

Is there any reason to not move forward with this? The upgrade to 1.1.0 fails for my application because of this issue.

Error: resources/assets/js/components/common/forms/checkbox-group/CheckboxGroup.tsx(2,15): error TS2459: Module '"@radix-ui/react-checkbox"' declares 'CheckedState' locally, but it is not exported.
Error: resources/assets/js/components/common/forms/checkbox-group/CheckboxGroup.types.ts(2,15): error TS2459: Module '"@radix-ui/react-checkbox"' declares 'CheckedState' locally, but it is not exported.
Error: resources/assets/js/components/common/forms/checkbox/Checkbox.stories.tsx(2,15): error TS2459: Module '"@radix-ui/react-checkbox"' declares 'CheckedState' locally, but it is not exported.
Error: resources/assets/js/components/common/forms/checkbox/Checkbox.types.ts(2,15): error TS245[9](https://github.com/Pairin/cps-staff-portal/actions/runs/9696086840/job/26757249212?pr=7941#step:6:10): Module '"@radix-ui/react-checkbox"' declares 'CheckedState' locally, but it is not exported.

@bdsqqq
Copy link
Author

bdsqqq commented Jul 2, 2024

Closing since #2984 was merged

@bdsqqq bdsqqq closed this Jul 2, 2024
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.

4 participants