-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(dropdown): unnecessary ref in dropdown #4278
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 0d0b8ce The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
WalkthroughThis pull request implements a patch for the Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🔇 Additional comments (4).changeset/soft-pugs-travel.md (1)
The patch version bump is correct for this bug fix, and the commit message properly references the issue being fixed. packages/components/dropdown/src/use-dropdown.ts (3)
The simplified implementation properly removes the ref parameter while maintaining the essential functionality. This change aligns with the PR objective and resolves the console warning about function components not accepting refs.
The updated type signature correctly reflects the removal of the ref parameter from getMenuTriggerProps. Line range hint Let's verify that no components rely on the removed ref functionality. ✅ Verification successfulChanges to getMenuTriggerProps are safe to proceed Based on the codebase analysis:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any direct usage of getMenuTriggerProps that might expect a ref parameter
rg -l 'getMenuTriggerProps.*ref' --type ts
# Search for PopoverTrigger implementation to confirm it doesn't use refs
ast-grep --pattern 'export const PopoverTrigger = $$$'
Length of output: 101 Script: #!/bin/bash
# Let's try a broader search for getMenuTriggerProps usage
rg -A 5 "getMenuTriggerProps" --type ts
# Search for PopoverTrigger in a different way
fd -e ts -e tsx -x cat {} \; | rg -A 10 "PopoverTrigger"
# Look for any files that might be using the Dropdown component
rg -l "useDropdown" --type ts
Length of output: 18745 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Closes #4245
📝 Description
In #4198,
forwardRef
has been removed fromPopoverTrigger
since the ref is not used there. The reported warning was caused by passing ref to PopoverTrigger, which no longer accepts. Since the ref will not be used, this PR is to avoid passing the unnecessary ref to PopoverTrigger.⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit
Bug Fixes
New Features
getMenuTriggerProps
method in the dropdown component for easier usage and clarity.