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 component initialization and teardown #36

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

OliverO2
Copy link
Contributor

This PR intends to fix component lifecycle handling, as seems to be required according to the MDC guide:

  • Use ref or DisposableRefEffect for component initialization (which runs once on entering a composition) instead of DomSideEffect (which runs on each recomposition).
  • Add component teardown via destroy(), which was previously missing.

* Use 'ref' or 'DisposableRefEffect' for component initialization (which
runs once on entering a composition) instead of `DomSideEffect` (which
runs on each recomposition).
* Add component teardown, which was previously missing.
Copy link
Owner

@mpetuska mpetuska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, great work on the PR, thanks. Left few minor comments for you to look into.

@mpetuska mpetuska merged commit e8cdf12 into mpetuska:master Dec 1, 2021
@OliverO2 OliverO2 deleted the fix/component-lifecycle branch December 2, 2021 18:15
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.

2 participants