feat(react-utils): add useRefObject hook - #816
Conversation
🦋 Changeset detectedLatest commit: 2a23b84 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
🚀 New features to boost your workflow:
|
ac8f87a to
f6f3aec
Compare
There was a problem hiding this comment.
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:unitpnpm -F @noaignite/react-utils test:typespnpm -F @noaignite/react-utils lintpnpm -F @noaignite/react-utils build
Risk level: Low (new hook + tests + export + changeset).
Changes:
- Add
useRefObjecthook for normalizing refs to aRefObject. - Add unit tests covering forwarded refs, callback refs, and
undefinedinput. - 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.
f6f3aec to
2a23b84
Compare
No description provided.