2016-05-19 71 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

相關問題