Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
shouldComponentUpdate (nextProps, nextState) {
return (
!shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState)
)
}
shouldComponentUpdate (nextProps, nextState, nextContext) {
const themeContextWillChange = !deepEqual(
ThemeContext.getThemeContext(this.context),
ThemeContext.getThemeContext(nextContext)
)
if (themeContextWillChange) return true
if (super.shouldComponentUpdate) {
return super.shouldComponentUpdate(nextProps, nextState, nextContext)
}
return (
!shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState) ||
!shallowEqual(this.context, nextContext)
)
}
componentDidUpdate (prevProps, prevState, prevContext) {
shouldComponentUpdate (nextProps, nextState) {
return (
!shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState)
)
}
shouldComponentUpdate (nextProps, nextState, nextContext) {
const themeContextWillChange = !deepEqual(
ThemeContext.getThemeContext(this.context),
ThemeContext.getThemeContext(nextContext)
)
if (themeContextWillChange) return true
if (super.shouldComponentUpdate) {
return super.shouldComponentUpdate(nextProps, nextState, nextContext)
}
return (
!shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState) ||
!shallowEqual(this.context, nextContext)
)
}
componentDidUpdate (prevProps, prevState, prevContext) {
shouldComponentUpdate (nextProps, nextState, nextContext) {
const themeContextWillChange = !deepEqual(
ThemeContext.getThemeContext(this.context),
ThemeContext.getThemeContext(nextContext)
)
if (themeContextWillChange) return true
if (super.shouldComponentUpdate) {
return super.shouldComponentUpdate(nextProps, nextState, nextContext)
}
return (
!shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState) ||
!shallowEqual(this.context, nextContext)
)
}
componentDidUpdate (prevProps, prevState, prevContext) {
shouldComponentUpdate (nextProps, nextState) {
return !(shallowEqual(this.props, nextProps) && shallowEqual(this.state, nextState))
}
shouldComponentUpdate (nextProps, nextState, nextContext) {
return (
!deepEqual(this.state, nextState) ||
!shallowEqual(this.props, nextProps) ||
!shallowEqual(this.context, nextContext)
)
}
shouldComponentUpdate (nextProps, nextState, nextContext) {
return (
!deepEqual(this.state, nextState) ||
!shallowEqual(this.props, nextProps) ||
!shallowEqual(this.context, nextContext)
)
}