You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to separate the 3 problems reported by this package into 3 separate rules so they can be disabled/enabled separately? The 3 problems are:
Do not pass an object into setState. Use functional setState updater instead. (tslint-react-set-state-usage)
Do not access 'this.props' in setState. Use arguments from callback function instead. (tslint-react-set-state-usage)
Do not access 'this.state' in setState. Use arguments from callback function instead. (tslint-react-set-state-usage)
Also, there is no (prevState) argument passed to the second callback parameter, so there is no way to fix the reported error about the 'this.state' usage in this snippet:
this.setState(
{ expanded: true },
() => {
if (this._menu && this.state.expanded)
this._menu.focus();
});
Thanks
The text was updated successfully, but these errors were encountered:
Would it be possible to separate the 3 problems reported by this package into 3 separate rules so they can be disabled/enabled separately? The 3 problems are:
Also, there is no (prevState) argument passed to the second callback parameter, so there is no way to fix the reported error about the 'this.state' usage in this snippet:
this.setState(
{ expanded: true },
() => {
if (this._menu && this.state.expanded)
this._menu.focus();
});
Thanks
The text was updated successfully, but these errors were encountered: