[utils] Allow _native to return statics

This commit is contained in:
Elliot Hesp 2017-11-30 11:27:59 +00:00
parent fb8c08c7f6
commit e452f514a3
1 changed files with 7 additions and 3 deletions

View File

@ -351,9 +351,13 @@ export function nativeWithApp(appName: string, NativeModule: Object) {
for (let i = 0, len = methods.length; i < len; i++) {
const method = methods[i];
native[method] = (...args) => {
return NativeModule[method](...[appName, ...args]);
};
if (isFunction(NativeModule[method])) {
native[method] = (...args) => {
return NativeModule[method](...[appName, ...args]);
};
} else {
native[method] = NativeModule[method];
}
}
return native;