I want to write es6 class:
class SomeClass {
static prop = 123
method() {
}
}
How to get access to static prop
from <
Microsoft programmer talking this but there is not a good way to type constructor
. You can use this tip first.
class SomeClass {
/**
* @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146
*/
['constructor']: typeof SomeClass
static prop = 123
method() {
this.constructor.prop // number
}
}