React-data-grid: Warning: Cell: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.

Created on 14 Jun 2017  路  2Comments  路  Source: adazzle/react-data-grid

WHICH VERSION OF REACT ARE YOU USING?

Officially Supported:
[X] v15.6.0 https://facebook.github.io/react/blog/2017/06/13/react-v15.6.0.html

WHICH BROWSER ARE YOU USING?

Officially Supported:
[X] Chrome

I'm submitting a ... (check one with "x")

[ X ] bug report

Current behavior
Javascript error stating: warning.js:36 Warning: Cell: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.

This has been anti-pattern a long time
https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html

// Cell.js


setScrollLeft: function setScrollLeft(scrollLeft) {
        var ctrl = this; // flow on windows has an outdated react declaration, once that gets updated, we can remove this
        if (ctrl.isMounted()) { 
          var node = ReactDOM.findDOMNode(this);
          if (node) {
            var transform = 'translate3d(' + scrollLeft + 'px, 0px, 0px)';
            node.style.webkitTransform = transform;
            node.style.transform = transform;
          }
        }
      },

Expected/desired behavior
No error.

Most helpful comment

Same here! Hard to troubleshoot the cause...

All 2 comments

Same here! Hard to troubleshoot the cause...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryanwtyler picture ryanwtyler  路  3Comments

oliverwatkins picture oliverwatkins  路  4Comments

ganapativs picture ganapativs  路  4Comments

alvaro1728 picture alvaro1728  路  4Comments

Suprit-S-M picture Suprit-S-M  路  4Comments