-
Notifications
You must be signed in to change notification settings - Fork 7
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
getData
dependency inside useEffect
#132
Comments
Workaround I am using: // eslint-disable-next-line react-hooks/exhaustive-deps
const getDataMemo = useMemo(() => getData, []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a developer I expect
getData
function to be immutable, so I can use it as a dependency insideuseEffect
. However it seems likegetData
function is re-created on each render.Simple example
The text was updated successfully, but these errors were encountered: