When I am using non remote js debug mode, I am getting

There was similar error but for 0.45 https://github.com/realm/realm-js/issues/1049
JS Exception after calling executeBlockOnJavaScriptThread on bridge

I have the same error with disabled JS debug. When js debug is on - the error is not there. (in my case it is 0.46.0rc2
+1
Yeap, It's exception


So, I started to use ensureOnJavaScriptThread, going to prepare PR
@javache Hey bro! You introduced changes inside react-native repository https://github.com/facebook/react-native/commit/8525aac769a08ca63fd932ac19c6bbbee81d39fb#diff-a2a67635fffd7b690d14dc17ae563a71
So, main question can you give a good advice how to check method exists compatiblity for RN 0.46+
Currently, inside https://github.com/ovr/realm-js/commit/71614726c110512499a4244eef0b14f7b439afb6
I am using
Class RCTCxxBridgeClass = NSClassFromString(@"RCTCxxBridge");
if ([RCTCxxBridgeClass instancesRespondToSelector:@selector(ensureOnJavaScriptThread:)]) {
[bridge ensureOnJavaScriptThread:bridgeInitializer];
} else {
[bridge executeBlockOnJavaScriptThread:bridgeInitializer];
}
Thank you 馃嵑 馃嵒
If you're going to be using private API's (which is not supported, and will likely break again in future releases), use dispatchBlock:block queue:RCTJSThread, which is implemented in both the old and the new bridge (and works on older releases too)
@javache Thank you
Fixed in #1122
Most helpful comment
If you're going to be using private API's (which is not supported, and will likely break again in future releases), use
dispatchBlock:block queue:RCTJSThread, which is implemented in both the old and the new bridge (and works on older releases too)