【发布时间】:2016-05-19 15:46:43
【问题描述】:
我使用来自https://github.com/realm/realm-js/blob/master/examples/ReactExample/components/realm.js 的示例代码。
'use strict';
import Realm from 'realm';
class Todo extends Realm.Object {}
Todo.schema = {
name: 'Todo',
properties: {
done: {type: 'bool', default: false},
text: 'string',
},
};
class TodoList extends Realm.Object {}
TodoList.schema = {
name: 'TodoList',
properties: {
name: 'string',
items: {type: 'list', objectType: 'Todo'},
},
};
export default new Realm({schema: [Todo, TodoList]});
当我运行这个时,我得到了
超级表达式必须是 null 或函数,而不是对象
错误。
我正在使用
"react": "^0.14.8",
"react-native": "^0.25.1",
"realm": "^0.12.0",
我该如何解决这个问题?感谢您的任何提示!
【问题讨论】:
标签: react-native realm react-native-android