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 fromNSObject
to RN modules instead of passingRLMObject
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?