Fix for failing React Native test on iOS

This commit is contained in:
Scott Kyle 2016-04-18 16:06:59 -07:00
parent bc4bda876c
commit 73cfca7d81
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ if (typeof Realm != 'undefined') {
realmConstructor = require('./browser').default; // (exported as ES6 module)
// eslint-disable-next-line
} else if (typeof process == 'object' && ('' + process) == '[object process]') {
realmConstructor = require('bindings')('realm').Realm;
// Prevent React Native packager from seeing this module.
const bindings = 'bindings';
realmConstructor = require(bindings)('realm').Realm;
} else {
throw new Error('Missing Realm constructor - please ensure RealmReact framework is included!');
}