Closed bdsqqq closed 3 months ago
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.
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.
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.
Closing since #2984 was merged
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.