-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Enabling useDefineForClassFields
in TypeScript will prevent decorators from working (both transpiled and using mobx.decorate
).
This flag will be enabled by default for ESNext
once class fields go stage 4: microsoft/TypeScript#34787
Possibly related to #1969
Intended outcome:
autorun
using objectState
is executed upon clicking on "increment" button.
autorun
using classState
is executed upon clicking on "increment" button.
autorun
using classStateNoDecorator
is executed upon clicking on "increment" button.
Actual outcome:
✅ autorun
using objectState
is executed upon clicking on "increment" button.
⛔️ autorun
using classState
is NOT executed upon clicking on "increment" button.
⛔️ autorun
using classStateNoDecorator
is NOT executed upon clicking on "increment" button.
How to reproduce the issue:
https://codesandbox.io/s/fragrant-frog-x2487
Versions
TypeScript 3.7+
MobX - all tested versions (4.x, 5.x)