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 types of useAnchoredPosition to avoid type assertions. #4448

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

T-Hugs
Copy link
Contributor

@T-Hugs T-Hugs commented Mar 28, 2024

Closes #4447

Changelog

New

Changed

useAnchoredPosition types updated to remove user type assertions

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

@T-Hugs T-Hugs requested a review from a team as a code owner March 28, 2024 15:48
Copy link

changeset-bot bot commented Mar 28, 2024

⚠️ No Changeset found

Latest commit: 3c5eebb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

Hello @T-Hugs 👋🏻 Sorry for late review! Thanks so much for pushing this PR 🙌🏻 Left one question - and would recommend running integration tests at dotcom to make sure we are not introducing anything breaking. Let me know if you have any questions or concerns 🙌🏻

@@ -277,7 +266,7 @@ export const WithPortal = () => {
const mainRef = React.useRef<HTMLElement>(null)

// Calculate the position of the menu
const {floatingElementRef, anchorElementRef, position} = useAnchoredPosition(
const {floatingElementRef, anchorElementRef, position} = useAnchoredPosition<HTMLButtonElement>(
Copy link
Member

Choose a reason for hiding this comment

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

Does this require assertion from people that we don't have it now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants