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: ref type on useCheckboxGroup and useRadioGroup #3111

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

mimarz
Copy link
Collaborator

@mimarz mimarz commented Feb 7, 2025

Fixes bug reported in by slack, when using our useCheckboxGroup and useRadioGroup with respective Checkbox and Radio component.

This was probably due to changes in types used for forwardRef in React 19.

Type '{ name?: string | undefined; title?: string | undefined; description?: ReactNode; placeholder?: string | undefined; form?: string | undefined; onChange?: ChangeEventHandler<HTMLInputElement> | undefined; ... 288 more ...; label: string; }' is not assignable to type 'RefAttributes<HTMLInputElement>'.
Types of property ref are incompatible.

Copy link

changeset-bot bot commented Feb 7, 2025

🦋 Changeset detected

Latest commit: 99d66ea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@digdir/designsystemet-react Patch
@digdir/designsystemet Patch
@digdir/designsystemet-css Patch
@digdir/designsystemet-theme Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Preview deployments for this pull request:

Storybook - 7. Feb 2025 - 08:37

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 54.06% 3186 / 5893
🔵 Statements 54.06% 3186 / 5893
🔵 Functions 82.94% 180 / 217
🔵 Branches 76.79% 523 / 681
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/utilities/hooks/useCheckboxGroup/useCheckboxGroup.ts 100% 90.69% 100% 100%
packages/react/src/utilities/hooks/useRadioGroup/useRadioGroup.ts 100% 90.47% 100% 100%
Generated in workflow #1982 for commit 99d66ea by the Vitest Coverage Report Action

@mimarz mimarz changed the title Fix ref type on useCheckboxGroup and useRadioGroup fix: ref type on useCheckboxGroup and useRadioGroup Feb 7, 2025
@mimarz mimarz merged commit 171c455 into next Feb 10, 2025
12 of 13 checks passed
@mimarz mimarz deleted the fix-type-react-useGroup branch February 10, 2025 10:22
mimarz added a commit that referenced this pull request Feb 21, 2025
Fixes bug reported in by slack, when using our `useCheckboxGroup` and
`useRadioGroup` with respective `Checkbox` and `Radio` component.

This was probably due to changes in types used for `forwardRef` in React
19.

```sh
Type '{ name?: string | undefined; title?: string | undefined; description?: ReactNode; placeholder?: string | undefined; form?: string | undefined; onChange?: ChangeEventHandler<HTMLInputElement> | undefined; ... 288 more ...; label: string; }' is not assignable to type 'RefAttributes<HTMLInputElement>'.
Types of property ref are incompatible.
```
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.

3 participants