fix(android, app): fix hot-reload on react-native <= 0.73 #8160
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.
Description
super.invalidate() is an empty function in rn >= 0.74, so no need to call it going forward
But on rn <= 0.73 it may not exist, and if it does it calls onCatalystInstanceDestroy which makes for a StackOverFlowException as we go recursive
Related issues
This fixes an error I made in the previous PR related to this that fixed hot-reload for RN >= 0.74
Release Summary
A single conventional commit
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
I got my make-demo.sh script branch from rn73 days, updated it for the reproduction.
Successfully reproduced the issue.
Fixed it there with this patch, then tested it with signout/signin/hot-reload etc to make sure I did not regress the original reason for PR #8139
https://github.com/mikehardy/rnfbdemo/commits/rn73/
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter