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

Fixes issue with combining inferno-mobx observer with animations #1587

Merged
merged 1 commit into from
Dec 28, 2021

Conversation

Gwenio
Copy link
Contributor

@Gwenio Gwenio commented Dec 20, 2021

Closes Issue

The track method of the MobX reaction in observers can be called after dispose is called on it.

The issue has a number of requirements to occur that would make it rare;

  • A call to forceUpdate needs to be queued to run async.
  • Then the component needs to be unmounted, calling componentWillUnmount which disposes of the reaction.
  • The component needs to be keep from being fully unmounted due to exit animations.

Then queue forceUpdate can then result in a call to render which calls track.

The solution implemented restores the original render method of the component that does not call track when the reaction is disposed.

@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.004%) to 92.011% when pulling 66a60d2 on Gwenio:master into c658a41 on infernojs:master.

@Havunen Havunen merged commit 6508421 into infernojs:master Dec 28, 2021
@Havunen
Copy link
Member

Havunen commented Dec 28, 2021

Thanks, I will try to add a test for it too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants