2016-05-19 67 views
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]}); 

当我运行它,我得到了

超表达必须是空或功能,不会反对

错误。

enter image description here

我使用

"react": "^0.14.8", 
"react-native": "^0.25.1", 
"realm": "^0.12.0", 

我怎样才能解决这个问题呢?谢谢你的提示!

回答

0

这固定在即将推出的最新版本0.13.0。您可以通过在您的package.json中将版本设置为0.13.0-rc来尝试发布候选版本

+0

太棒了。谢谢! – sungl

相关问题