Skip to content

Cannot set property displayName on class which has only a getter #845

Closed
Omrisnyk/npm-lockfiles
#153
@humulus

Description

@humulus

Description

This part of code is unable to set displayName because class has only getter's
react-hot-loader/packages/react-stand-in/src/createClassProxy.js

// Try to infer displayName
const displayName = getDisplayName(CurrentComponent)
ProxyFacade.displayName = displayName

Expected behavior

react-hot-loader should support classes with static getter's like

static get displayName() {
    return "button";
}

static get defaultProps() {
    return {
        type: "primary",
    };
}

Actual behavior

react-hot-loader/packages/react-stand-in/src/createClassProxy.js

Uncaught TypeError: Cannot set property displayName of function C3Chart() {
    _classCallCheck(this, C3Chart);

    return _possibleConstructorReturn(this, (C3Chart....<omitted>... } which has only a getter
    at update (createClassProxy.js?1dd3:210)

Environment

React Hot Loader version: 4.0.0-beta.21
Node version: v8.9.4
NPM version: 5.1.0
Ubuntu 14.04
Google Chrome: 64

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions