This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 226
Adding onFirstUpdate function kills the page #448
Comments
I think you should memoize that function with |
Unfortunately useCallback doesn't solve this issue. |
onFirstUpdate: useCallback((state) => {
console.log("Popper positioned on", state.placement)
}, []) |
Okay, you're right, useCallback does solve it, but i think there is still an issue, why passing new function causes infinite rerender of component ? |
I experience the same problem and I'm agree with @piechoo |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Reproduction demo
https://codesandbox.io/s/react-popper-v2-x-issue-template-forked-k37vgt?file=/src/index.js
Steps to reproduce the problem
What is the expected behavior?
It should run function on first update and not kill the page :)
What went wrong?
The page is totally unresponsive
Any other comments?
Packages versions
The text was updated successfully, but these errors were encountered: