Prevent excessive re-rendering
parent
da4ed5f9f7
commit
99f5129447
|
@ -2,6 +2,7 @@ import React, {Component} from 'react'
|
|||
import PropTypes from 'prop-types'
|
||||
|
||||
import uuid from 'uuid'
|
||||
import _ from 'lodash'
|
||||
|
||||
import UsersTableHeader from 'src/admin/components/chronograf/UsersTableHeader'
|
||||
import UsersTableRowNew from 'src/admin/components/chronograf/UsersTableRowNew'
|
||||
|
@ -18,6 +19,12 @@ class UsersTable extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
return (
|
||||
!_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState)
|
||||
)
|
||||
}
|
||||
|
||||
handleChangeUserRole = (user, currentRole) => newRole => {
|
||||
this.props.onUpdateUserRole(user, currentRole, newRole)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue