-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
has PR🎁 mobxIssue or PR related to mobx packageIssue or PR related to mobx package🐛 bug👓 needs investigation
Description
Reproducible example:
Please, have a look at
CodeSandBox.
Copy of the code
import { action, computed, makeObservable, observable } from "mobx";
class A {
public constructor() {
makeObservable(this);
}
// @action aAction = () => "aAction";
// @computed get aGetter() {
// return "aGetter";
// }
// aMethod() {
// return "aMethod";
// }
// @observable aObservable = "aObservable";
// aProperty = "aProperty";
}
class B extends A {
public constructor() {
super();
makeObservable(this);
}
// UNCOMMENT ME TO BREAK
// @action bAction = () => "bAction";
@computed get bGetter() {
return "bGetter";
}
bMethod() {
return "bMethod";
}
// UNCOMMENT ME TO BREAK
// @observable bObservable = "bObservable";
bProperty = "bProperty";
}
class C extends B {
public constructor() {
super();
makeObservable(this);
}
// UNCOMMENT ME TO REPAIR
// @action cAction = () => "cAction";
@computed get cGetter() {
return "cGetter";
}
// cMethod() {
// return "cMethod";
// }
// UNCOMMENT ME TO REPAIR
// @observable cObservable = "cObservable";
// cProperty = "cProperty";
}
const c: C = new C();
console.log("OK", c);
How to reproduce the issue:
-
Uncomment either one from
// UNCOMMENT ME TO BREAK
sections to see an error:
Cannot decorate undefined property: ...
-
Then comment either one from
// COMMENT ME TO REPAIR
sections to remove the error.
Versions:
[email protected]
[email protected]
,"useDefineForClassFields": true
@babel/[email protected]
,"loose": false
Metadata
Metadata
Assignees
Labels
has PR🎁 mobxIssue or PR related to mobx packageIssue or PR related to mobx package🐛 bug👓 needs investigation