react-native-realm
A higher-order component for listening to Realm data in React Native components.
Usage
// realm.js; Object {}Personschema = name: 'Person' properties: firstName: type: 'string' lastName: type: 'string' ; return schema: Person;
// App.js ;; ...// render function of your top level component for your app { <RealmProvider realm=realm> <MyComponent /> </RealmProvider>}...
// MyComponent.js ; { const realm = thisprops; realm; }; { <PeopleList people=thispropspeople /> } MyComponent schemas: 'Person' { // the object that is returned from the mapToProps function // will be merged into the components props return realm // property on the results argument is the camel-cased and // pluralized version of the schema name, so... // instead of person being the property we get people people: resultspeople ; };
Examples
Check out the example react native app to see react-native-realm in use.