Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16760

iOS native Realm conflict with React Native RealmJS

$
0
0

My APP has some RN modules using RealmJS.

I integrated realm-cocoa as database to cache some server data for native usage. This works fine when I do not open any RN modules. While I open any RN modules and back to native part, all my Realm Object models as UI data become invalid and any data accesses to those model causes a crash.

The exception note is

RLMException(@"Object has been deleted or invalidated.");

I have tried all the ways below but none of them works:

  • Creating my own DB instead of using [RLMRealm defaultRealm] API
  • Passing a RLMObject instance copy inherited from NSObject to RN modules instead of passing RLMObject type directly
  • Synchronizing realm-cocoa and realm-js version in same Realm Core with v6.0.26 and Realm Sync with v5.0.23

It seems that it's not recommended using both realm and realm-js in RN in the same project officially, but I can't find any statements telling this in official docs.

So can some guys help me, how to make Realms in different platforms works compatibly?

Or just Realm can only be used in one platform in one hybrid project?


Viewing all articles
Browse latest Browse all 16760

Trending Articles