3

反応プロジェクトで FixedDataTable を使用すると、以下の警告が表示されて驚いています。

warning.js:36 Warning: FixedDataTable: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.

私が理解したことは、isMounted がアンチパターンリンクと見なされているため、実際のソース コードでそれを確認して驚いたことです。ここで何か不足していますか?

  _didScrollStop: function _didScrollStop() {
    if (this.isMounted() && this._isScrolling) {
      this._isScrolling = false;
      this.setState({ redraw: true });
      if (this.props.onScrollEnd) {
        this.props.onScrollEnd(this.state.scrollX, this.state.scrollY);
      }
    }
  }
4

0 に答える 0