Skip to content
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

Fix lost reactivity when using deps #314

Merged
merged 1 commit into from
Jan 28, 2021
Merged

Fix lost reactivity when using deps #314

merged 1 commit into from
Jan 28, 2021

Conversation

CaptainN
Copy link
Contributor

@CaptainN CaptainN commented Jan 28, 2021

This attempts to fix various lost reactivity reports, as well as some trouble with a particular "Maximum update depth exceeded" error, coming from (possibly) constantly updating deps interaction with useEffect, in two ways:

  • Adds guards against containing computations effecting the enclosed computation in useEffect.
  • Adds a system to keep the reference to reactiveFn always up to date with the latest render.

All tests are passing, but I'd like to see if we can work out a test to confirm the reported error.

#313

@CaptainN
Copy link
Contributor Author

CaptainN commented Jan 28, 2021

We have at least one validation that the approach in this PR fixes the reported issue. @filipenevola Due to the severity of this bug, I don't think we should wait for a test - we should release a new version 2.2.2.

#313 (comment)

@make-github-pseudonymous-again

Repeating what I said in #306:

  • @CaptainN I confirm using deps in useTracker works as expected in my project with [email protected].
  • Could a hook waterfall be used as regression test for this fix?

make-github-pseudonymous-again added a commit to infoderm/patients that referenced this pull request Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants