Skip to content

feat(react-utils): add useRefObject hook - #816

Merged
Dashice merged 1 commit into
mainfrom
feature/use-ref-object
Aug 31, 2026
Merged

feat(react-utils): add useRefObject hook#816
Dashice merged 1 commit into
mainfrom
feature/use-ref-object

Conversation

@Dashice

@Dashice Dashice commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Dashice Dashice self-assigned this Aug 31, 2026
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a23b84

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

This PR includes changesets to release 1 package
Name Type
@noaignite/react-utils Minor

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

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 31, 2026 12:47pm

Request Review

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #816      +/-   ##
==========================================
+ Coverage   70.62%   70.75%   +0.13%     
==========================================
  Files          67       68       +1     
  Lines        1062     1067       +5     
  Branches      268      268              
==========================================
+ Hits          750      755       +5     
  Misses        248      248              
  Partials       64       64              
Files with missing lines Coverage Δ
packages/react-utils/src/useRefObject.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new useRefObject hook to @noaignite/react-utils to normalize arbitrary React refs into an assignable RefObject, and exports it for consumers.

Changed packages/apps: @noaignite/react-utils

Changeset: Present (.changeset/funky-seas-rule.md) with a minor bump, which aligns with adding a new exported hook.

Docs impact: The new hook includes JSDoc that will likely surface in generated package docs; the example and type wording should be corrected to avoid misleading consumers.

Recommended verification commands:

  • pnpm -F @noaignite/react-utils test:unit
  • pnpm -F @noaignite/react-utils test:types
  • pnpm -F @noaignite/react-utils lint
  • pnpm -F @noaignite/react-utils build

Risk level: Low (new hook + tests + export + changeset).

Changes:

  • Add useRefObject hook for normalizing refs to a RefObject.
  • Add unit tests covering forwarded refs, callback refs, and undefined input.
  • Export the hook from the package entrypoint and add a changeset.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/react-utils/src/useRefObject.ts Introduces the new hook implementation and its JSDoc.
packages/react-utils/src/useRefObject.test.tsx Adds tests validating sync behavior for forwarded and callback refs.
packages/react-utils/src/index.ts Re-exports the new hook from the package public API.
.changeset/funky-seas-rule.md Declares a minor release for @noaignite/react-utils to ship the new hook.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/react-utils/src/useRefObject.ts Outdated
Comment thread packages/react-utils/src/useRefObject.ts Outdated
Comment thread packages/react-utils/src/useRefObject.ts

@maeertin maeertin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fire 🔥

@Dashice
Dashice merged commit 1b4424d into main Aug 31, 2026
5 checks passed
@Dashice
Dashice deleted the feature/use-ref-object branch August 31, 2026 12:54
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