diff --git a/src/core/action.ts b/src/core/action.ts index ddff349b3..ec59e7ecc 100644 --- a/src/core/action.ts +++ b/src/core/action.ts @@ -27,6 +27,12 @@ export function createAction(actionName: string, fn: Function, ref?: Object): Fu return executeAction(actionName, fn, ref || this, arguments) } ;(res as any).isMobxAction = true + if (process.env.NODE_ENV !== "production") { + const descriptor = Object.getOwnPropertyDescriptor(res, "name"); + if (descriptor && descriptor.configurable) { + Object.defineProperty(res, "name", {value: actionName}); + } + } return res as any }