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(android, app): fix hot-reload on react-native <= 0.73 #8160

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

mikehardy
Copy link
Collaborator

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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

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:

Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-firebase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 1:43pm

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
@mikehardy
Copy link
Collaborator Author

Cleaned up the comments only in the last push, did not change functionality but wanted them to be really clear about what the super class methods are doing in different versions, for any future devs going in there

Also re-tested on rn0.76 to make completely sure I didn't regress the original issue, it's all good

@mikehardy mikehardy merged commit 81e5fc2 into main Nov 25, 2024
19 checks passed
@mikehardy mikehardy deleted the fix-android-hot-reload-fix branch November 25, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛] App crashing on bundle reload [Android] on react-native 0.73
2 participants