How to use the @instructure/ui-utils.shallowEqual function in @instructure/ui-utils

To help you get started, we’ve selected a few @instructure/ui-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instructure / instructure-ui / packages / ui-popover / src / Popover / index.js View on Github external
shouldComponentUpdate (nextProps, nextState) {
    return (
      !shallowEqual(this.props, nextProps) ||
      !shallowEqual(this.state, nextState)
    )
  }
github instructure / instructure-ui / packages / ui-themeable / src / themeable.js View on Github external
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) {
github instructure / instructure-ui / packages / ui-popover / src / Popover / index.js View on Github external
shouldComponentUpdate (nextProps, nextState) {
    return (
      !shallowEqual(this.props, nextProps) ||
      !shallowEqual(this.state, nextState)
    )
  }
github instructure / instructure-ui / packages / ui-themeable / src / themeable.js View on Github external
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) {
github instructure / instructure-ui / packages / ui-themeable / src / themeable.js View on Github external
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) {
github instructure / instructure-ui / packages / ui-portal / src / Portal / SubtreePortal.js View on Github external
shouldComponentUpdate (nextProps, nextState) {
    return !(shallowEqual(this.props, nextProps) && shallowEqual(this.state, nextState))
  }
github instructure / instructure-ui / packages / ui-position / src / Position / index.js View on Github external
shouldComponentUpdate (nextProps, nextState, nextContext) {
    return (
      !deepEqual(this.state, nextState) ||
      !shallowEqual(this.props, nextProps) ||
      !shallowEqual(this.context, nextContext)
    )
  }
github instructure / instructure-ui / packages / ui-position / src / Position / index.js View on Github external
shouldComponentUpdate (nextProps, nextState, nextContext) {
    return (
      !deepEqual(this.state, nextState) ||
      !shallowEqual(this.props, nextProps) ||
      !shallowEqual(this.context, nextContext)
    )
  }