Nick
Nick

Reputation: 26

Realm - React Native and Objective C

I have a project that will be partly in react native mostly for the view layer and part objective-c for some heavy lifting. I would like to use Realm as a db for this and be able to access it from javascript and objective-c.

Wondering if anyone else has run into this and what approach did you take to handling it?

What I'm leaning towards is using objective-c realm and creating a RCTBridgeModule for it so I can use it from javascript.

Upvotes: 0

Views: 654

Answers (2)

TiM
TiM

Reputation: 16011

From what I've been told, it's possible to run both Realm React Native and Realm Objective-C in the same codebase.

As long as the schema definitions in the React Native code and the Objective-C code match, you should be able to read and write to the same Realm file on disk from both the React Native and Objective-C portions of your code.

Upvotes: 1

El Chapitan
El Chapitan

Reputation: 336

I believe an official plugin already exists for that: https://realm.io/docs/react-native/

Upvotes: 0

Related Questions