This repository has been archived by the owner on Jun 24, 2022. It is now read-only.
Updated react-navigation and related packages #841
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most of this is described in the issue: #445
Issue:
Currently, there's a scenario where the app shows a warning regarding a memory leak, caused by
setstate
being called on an unmounted component.Reproduction steps:
Clear Cache
andClear Storage
Solution:
After further inspection, I don't believe there's anything in our app code that's causing the problem. The problem seems to come from a
setTimeout
inreact-navigation
that happens when the app comes from background to foreground. This problem was described here:react-navigation/react-navigation#8226
And solved in a recent version of
react-navigation
:react-navigation/react-navigation@0149e85
I tried updating
@react-navigation/stack
only, but that didn't fix the warning. However, updating all related@react-navigation
packages seems to fix the warning completely.Notes:
Interesting to note that the
react-navigation
fix, in my opinion, is an anti-pattern as described here: https://reactjs.org/blog/2015/12/16/ismounted-antipattern.htmlBut oh well, it's in their own package, and I'm sure a lot of smart people are working on that package so maybe this instance is acceptable.