Skip to content

fix(Popover): Update component to forward ref - #5320

Merged
hussam-i-am merged 2 commits into
mainfrom
hussam-i-am/fix-popover-ref
Nov 20, 2024
Merged

fix(Popover): Update component to forward ref#5320
hussam-i-am merged 2 commits into
mainfrom
hussam-i-am/fix-popover-ref

Conversation

@hussam-i-am

@hussam-i-amhussam-i-am commented Nov 20, 2024

Copy link
Copy Markdown
Contributor

Fixes the failing integration test related to ref forwarding in Popover:

Error:Error: Expected test not to call console.error().
If the error is expected, test for it explicitly by mocking it out using jest.spyOn(console, 'error').mockImplementation() and test that the warning occurs.
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
Check the render method of `ValidationErrorPopover`.
at className (/workspace/github/node_modules/@primer/react/lib/Popover/Popover.js:34:3)
at id (/workspace/github/ui/packages/validation-error-popover/ValidationErrorPopover.tsx:65:3)
at div
[...truncated...]

Changelog

New

Changed

  • Wraps Popover in a forwardRef function

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@hussam-i-amhussam-i-am self-assigned this Nov 20, 2024
@hussam-i-am
hussam-i-am requested a review from a team as a code ownerNovember 20, 2024 19:23
@changeset-bot

changeset-botBot commented Nov 20, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a78d483

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

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

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

@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 20, 2024
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions

github-actionsBot commented Nov 20, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js100.55 KB (-0.01% 🔽)
packages/react/dist/browser.umd.js101.01 KB (-0.06% 🔽)

@francineluccafrancinelucca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@hussam-i-am
hussam-i-am added this pull request to the merge queueNov 20, 2024
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Nov 20, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5320 November 20, 2024 20:13 Inactive
@hussam-i-am
hussam-i-am added this pull request to the merge queueNov 20, 2024
Merged via the queue into main with commit e9e4d1cNov 20, 2024
@hussam-i-am
hussam-i-am deleted the hussam-i-am/fix-popover-ref branch November 20, 2024 20:36
@primerprimerBot mentioned this pull request Nov 20, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@hussam-i-am@francinelucca