Skip to content

Commit

Permalink
Don't call ReactBridge.staticInit() on the main thread
Browse files Browse the repository at this point in the history
Summary: Adding a hook to check if ReactBridge is initialized so we can avoid loading the .so on the main thread.

Reviewed By: fkgozali

Differential Revision: D17747958

fbshipit-source-id: 5969afa57dc1b446c03bc68eaa9e1385fe17c461
  • Loading branch information
Emily Janzer authored and facebook-github-bot committed Oct 3, 2019
1 parent a45e6a8 commit 7d8b7ff
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public class ReactBridge {

private static boolean sDidInit = false;

public static boolean isInitialized() {
return sDidInit;
}

public static synchronized void staticInit() {
if (sDidInit) {
return;
Expand Down

0 comments on commit 7d8b7ff

Please sign in to comment.