问题
I use example code from 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]});
When I run this, I got
Super expression must either be null or a function, not object
error.
I am using
"react": "^0.14.8",
"react-native": "^0.25.1",
"realm": "^0.12.0",
How can I solve this issue? Thank you for any tip!
回答1:
This is fixed in the newest version 0.13.0
which is coming out shortly. You can try the release candidate now by setting the version to 0.13.0-rc
in your package.json
来源:https://stackoverflow.com/questions/37328215/super-expression-must-either-be-null-or-a-function-not-object-error