-
Notifications
You must be signed in to change notification settings - Fork 185
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
feat(Popover): add usePopover hook to select anchor of popover #7969
feat(Popover): add usePopover hook to select anchor of popover #7969
Conversation
size-limit report 📦
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
e2e tests |
👀 Docs deployed
Commit 006c44c |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7969 +/- ##
==========================================
- Coverage 95.49% 95.48% -0.02%
==========================================
Files 393 394 +1
Lines 11188 11195 +7
Branches 3708 3708
==========================================
+ Hits 10684 10689 +5
- Misses 504 506 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Описание
Нужно реализовать возможность управлять якорным элементом для поповера, не прокидывая его в children
Изменения
usePopover
, который принимает все пропсы, которые принимаетPopover
, кромеchildren
, и возвращает:anchorRef
- реф, который нужно навесить на нужный якорный элементanchorProps
- пропсы, которые нужно навесить на якорный элементpopover
- готовыйReactNode
, который нужно отрендерить в DOM, чтобы поповер появилсяPopover
. Добавил пример с динамическим изменением якорного элемента.Release notes
Улучшения
Popover
снаружи