Skip to content

fix: replace RefObject with Ref for ref prop type#2170

Merged
hunshamar merged 4 commits intomainfrom
fix_ref_2
Apr 7, 2026
Merged

fix: replace RefObject with Ref for ref prop type#2170
hunshamar merged 4 commits intomainfrom
fix_ref_2

Conversation

@hunshamar
Copy link
Copy Markdown
Collaborator

@hunshamar hunshamar commented Apr 7, 2026

React.RefObject is too narrow as a prop type — it only accommodates
refs created with useRef, and its generic parameter does not include
null, causing type errors when consumers pass a RefObject<T | null>.

Replace RefObject with Ref, which
is the correct type for ref props as it accepts RefObject, callback
refs, and null.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

🦋 Changeset detected

Latest commit: bdb41f0

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

This PR includes changesets to release 1 package
Name Type
@vygruppen/spor-react 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

@hunshamar hunshamar changed the title fix ref fix: replace RefObject with Ref for ref prop type Apr 7, 2026
@hunshamar hunshamar merged commit ce9b9f1 into main Apr 7, 2026
9 checks passed
@hunshamar hunshamar deleted the fix_ref_2 branch April 7, 2026 10:16
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.

1 participant