Skip to content

call parent static function

Hill Liu edited this page Feb 20, 2018 · 4 revisions

Explain how to call ReshowComponent static function (calculateState and getStores)

In your class

        let superData;
        if (super.constructor.calculateState) {
            superData = super.constructor.calculateState(prevState);
        } else {
            superData = super.calculateState(prevState);
        }

After Babel compile

        var superData = void 0;
        if (_ReshowComponent.constructor.calculateState) {
            superData = _ReshowComponent.constructor.calculateState(prevState);
        } else {
            superData = _ReshowComponent.calculateState.call(this, prevState);
        }