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
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 |
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: