-
Notifications
You must be signed in to change notification settings - Fork 46k
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
useCallback doesn't memoize as expected #17221
Comments
Hi @cdoublev , |
I should stop creating issue at the end of the day. Thank you for enlighting me a little longer @miturostislav. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
useCallback
doesn't return a memoized function when used as a "higher order ref callback".https://codesandbox.io/s/snowy-tdd-wb8gu
https://reactjs.org/docs/refs-and-the-dom.html#caveats-with-callback-refs
What is the expected behavior?
https://reactjs.org/docs/hooks-reference.html#usecallback
It doesn't work with
useMemo
as well, even if #15774 looks similar. It works with a "standard" memoize function, like_.memoize
.As indicated in #17204, I was looking for a way to identify the unmounted node.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 16.11.0
The text was updated successfully, but these errors were encountered: