例如,我有一个类似于es6的类:
但是当我试图以这种方式编写代码时,出现了错误:
class Foo {...}
我想扩展它:
class Bar extends Foo {...}
在reason-react文档中,我找到了一些示例,但我不确定它是否适合我:let component = ReasonReact.reducerComponent "TodoAppRe";
let make _children => {
...component,
initialState: fun () => {count: 0},
<...>
但是当我试图以这种方式编写代码时,出现了错误:
let myclass unit => {
...mysuperclass,
hello: fun () => {
Js.log "FooBar";
}
};
错误:无限制记录字段更新
(在此示例中,mysuperclass
是来自第三方js库的外部类。)
也许我做错了什么?