1
我使用的示例代码从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]});
当我运行它,我得到了
超表达必须是空或功能,不会反对
错误。
我使用
"react": "^0.14.8",
"react-native": "^0.25.1",
"realm": "^0.12.0",
我怎样才能解决这个问题呢?谢谢你的提示!
太棒了。谢谢! – sungl