Skip to content

Commit

Permalink
FIX 867: add deprecated hasActiveCatalystInstance for old RN (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielEliraz authored May 8, 2022
1 parent aeaea30 commit a18a593
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ public synchronized boolean isReactInitialized() {
return false;
}

return mReactContext.hasActiveReactInstance();
try {
return mReactContext.hasActiveCatalystInstance();
} catch (Exception e) {
return mReactContext.hasActiveReactInstance();
}
}

@Override
Expand Down

1 comment on commit a18a593

@rob5408
Copy link

@rob5408 rob5408 commented on a18a593 Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there, mReactContext.hasActiveReactInstance() is a compile time error for me, not a runtime one, so this doesn't actually work for older RN versions. There's a good chance I'm doing something wrong though. I ended up just forking for now with only the call to hasActiveCatalystInstance.

Please sign in to comment.