I want to start using realm with react native (all platforms, incl. windows). So I followed your install instructions and copied few bits of code. I am also using expo, the new react-native way to run applications. The problem is I receive an error. I already done linking, both with rnpm and with react-native - didn't solve my problem.
Probably after ejecting it will work but I dont have mac to test my iOS part so I need to stay with expo.
Problem may be that expo is missing something.
I expected Realm to start normally.

Create RN app with create-react-native-app, open emulator and run npm android OR connect phone with installed expo to the same network as your PC and run npm start on PC.
import Realm from 'realm';
const CarSchema = {
name: 'Car',
properties: {
make: 'string',
model: 'string',
miles: {type: 'int', default: 0},
}
};
const PersonSchema = {
name: 'Person',
properties: {
name: 'string',
birthday: 'date',
cars: {type: 'list', objectType: 'Car'},
picture: {type: 'data', optional: true}, // optional property
}
};
// Initialize a Realm with Car and Person models
let realm = new Realm({schema: [CarSchema, PersonSchema]});
realm.write(() => {
let car = realm.create('Car', {
make: 'Honda',
model: 'Civic',
miles: 750,
});
// you can access and set all properties defined in your model
console.log('Car type is ' + car.make + ' ' + car.model);
car.miles = 1500;
});
"dependencies": {
"expo": "^19.0.0",
"react": "^16.0.0-alpha.12",
"react-native": "^0.46.1",
"react-redux": "^5.0.5",
"realm": "^1.10.0",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
}
Expo doesn't support Realm yet (https://forums.expo.io/t/is-realm-support-for-expo-coming/31) which explains it. Please ask Expo to add support.
The problem is still unsolved
Reeeeeeeeeeeeeeeeeeeeeeeeeeeealm pls!
@ali-so Doesn't help much here :-) Express the need here: https://expo.canny.io/feature-requests/p/support-for-realm
@kneth i am using expo but i have detached my project from expo . Seperate ios/android folders have been created .I assume then realm should work as normal ??
@kaulsalil88 I haven't tried that. Please report any findings :-)
Works properly on Android ,on IOS it just freezes the application doesnt throw any error . I am also not able to debug the issue further js debugging in the version of realm that i am using is causing the app to crash .
@kaulsalil88 At the moment, Realm isn't supported by Expo. It would be unusual if it works on Android.
P/s: I've added an upvote to Expo's Feature Request for Realm, here is a link if anyone interested. https://expo.canny.io/feature-requests
(search form 'Realm')
Most helpful comment
Reeeeeeeeeeeeeeeeeeeeeeeeeeeealm pls!