From 90b0b2deb88f89d8578044e5d62fee7652b91c9e Mon Sep 17 00:00:00 2001 From: Brandon Farmer Date: Wed, 18 Apr 2018 17:12:01 -0700 Subject: [PATCH] Convert stateful PureComponents to Component Removing errors caused by shouldComponentUpdate being called --- ui/src/admin/components/chronograf/OrganizationsTableRow.tsx | 4 ++-- ui/src/dashboards/components/TableOptions.tsx | 4 ++-- ui/src/shared/components/Crosshair.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/admin/components/chronograf/OrganizationsTableRow.tsx b/ui/src/admin/components/chronograf/OrganizationsTableRow.tsx index 2f3fcb5fee..424959942b 100644 --- a/ui/src/admin/components/chronograf/OrganizationsTableRow.tsx +++ b/ui/src/admin/components/chronograf/OrganizationsTableRow.tsx @@ -1,4 +1,4 @@ -import React, {PureComponent} from 'react' +import React, {Component} from 'react' import {connect} from 'react-redux' import {bindActionCreators} from 'redux' import {withRouter, InjectedRouter} from 'react-router' @@ -45,7 +45,7 @@ interface Props { } @ErrorHandling -class OrganizationsTableRow extends PureComponent { +class OrganizationsTableRow extends Component { public shouldComponentUpdate(nextProps) { return !_.isEqual(this.props, nextProps) } diff --git a/ui/src/dashboards/components/TableOptions.tsx b/ui/src/dashboards/components/TableOptions.tsx index eb4f872c32..c1056766cf 100644 --- a/ui/src/dashboards/components/TableOptions.tsx +++ b/ui/src/dashboards/components/TableOptions.tsx @@ -1,4 +1,4 @@ -import React, {PureComponent} from 'react' +import React, {Component} from 'react' import {connect} from 'react-redux' import {bindActionCreators} from 'redux' @@ -46,7 +46,7 @@ interface Props { } @ErrorHandling -export class TableOptions extends PureComponent { +export class TableOptions extends Component { constructor(props) { super(props) this.moveField = this.moveField.bind(this) diff --git a/ui/src/shared/components/Crosshair.js b/ui/src/shared/components/Crosshair.js index 5154e0bc3b..fafd3cac18 100644 --- a/ui/src/shared/components/Crosshair.js +++ b/ui/src/shared/components/Crosshair.js @@ -1,4 +1,4 @@ -import React, {PureComponent} from 'react' +import React, {Component} from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' @@ -7,7 +7,7 @@ import {NULL_HOVER_TIME} from 'shared/constants/tableGraph' import {ErrorHandling} from 'src/shared/decorators/errors' @ErrorHandling -class Crosshair extends PureComponent { +class Crosshair extends Component { shouldComponentUpdate(nextProps) { return this.props.hoverTime !== nextProps.hoverTime }