“Super expression must either be null or a function, not object” error

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 02:12:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!