-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create popover component #123
Conversation
Codecov Report
@@ Coverage Diff @@
## master #123 +/- ##
==========================================
+ Coverage 97.51% 97.98% +0.47%
==========================================
Files 18 22 +4
Lines 241 298 +57
Branches 43 51 +8
==========================================
+ Hits 235 292 +57
Misses 6 6
Continue to review full report at Codecov.
|
); | ||
const { asFragment, getByTestId } = render(component); | ||
|
||
await waitFor(() => getByTestId('menu-item-default')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to write it without await waitFor()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it complains about an update that has to be wrapped in "act"
onClose(); | ||
}, menuRef); | ||
|
||
const { styles: popperStyles, attributes } = usePopper(divRef.current, menuRef.current, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wat een ref sletje die usePopper 😀
@@ -0,0 +1,17 @@ | |||
import React, { useEffect } from 'react'; | |||
|
|||
export const useOutsideClick = (callback: Function, elementRef: React.RefObject<any>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice steal 😀. I also used this a week ago at work
🎉 This PR is included in version 1.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #70