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

Prevent setup plugins run multiple times #326

Merged
merged 1 commit into from
Apr 27, 2021
Merged

Conversation

roderickhsiao
Copy link
Collaborator

I notice that the setupI13n will now execute multiple times on top level app re-render (such as route change) even if the plugins or reactI13n instance are the same as we put the function in render.

Change to useEffect and also create life cycle to clean up plugins to prevent memory leaks

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@roderickhsiao roderickhsiao merged commit 9b0e317 into master Apr 27, 2021
@roderickhsiao roderickhsiao deleted the life-cycle-update branch April 27, 2021 20:32
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.

None yet

2 participants