react/no-is-mounted
February 9, 2026 ยท View on GitHub
๐ Disallow usage of isMounted.
๐ผ This rule is enabled in the โ๏ธ recommended config.
isMounted is an anti-pattern, is not available when using ES6 classes, and it is on its way to being officially deprecated.
Rule Details
Examples of incorrect code for this rule:
var Hello = createReactClass({
handleClick: function() {
setTimeout(function() {
if (this.isMounted()) {
return;
}
});
},
render: function() {
return <div onClick={this.handleClick.bind(this)}>Hello</div>;
}
});
Examples of correct code for this rule:
var Hello = createReactClass({
render: function() {
return <div onClick={this.props.handleClick}>Hello</div>;
}
});