Skip to content

Conversation

war-in
Copy link

@war-in war-in commented Jul 16, 2025

This PR continues the improvement introduced here: #107

Currently, the app isn't crashing, but it's throwing soft exceptions when trying to emit events before RCTDeviceEventEmitter is initialised

Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: raiseSoftException(callWithExistingReactInstance(callFunctionOnModule("RCTDeviceEventEmitter", "emit"))): Execute: reactInstance is null. Dropping work.

To fix this, I wrapped the second emit with

if (getReactApplicationContext().hasActiveReactInstance()) {
    ...
}

and changed the previous hasActiveCatalystInstance() to hasActiveReactInstance() as it has been deprecated

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.

1 participant