“超级表达式必须为null或函数,而不是对象".错误 [英] "Super expression must either be null or a function, not object" error

查看:129
本文介绍了“超级表达式必须为null或函数,而不是对象".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用来自 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

超级表达式必须为null或函数,而不是对象

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

错误.

我正在使用

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

如何解决此问题?谢谢你的提示!

How can I solve this issue? Thank you for any tip!

推荐答案

此问题已在即将发布的最新版本0.13.0中修复.您可以通过在package.json

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

这篇关于“超级表达式必须为null或函数,而不是对象".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆