How to use react-addons-pure-render-mixin - 9 common examples

To help you get started, we’ve selected a few react-addons-pure-render-mixin 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 asutherland / glodastrophe / www / lib / react-list.js View on Github external
length: 0,
        pageSize: 10,
        threshold: 500
      },
      enumerable: true
    }]);

    return List;
  })(_React.Component);

  exports.List = List;

  // asuth-hack: this is where the pure render mixin canonically lives now;
  // this whole file should be rebuilt/updated/whatever, but this works for now.
  List.prototype.shouldComponentUpdate =
    require('react-addons-pure-render-mixin').shouldComponentUpdate;

  var UniformList = (function (_List) {
    function UniformList() {
      _classCallCheck(this, UniformList);

      if (_List != null) {
        _List.apply(this, arguments);
      }

      this.state = {
        from: 0,
        itemHeight: this.props.itemHeight || 0,
        itemsPerRow: this.props.itemsPerRow || 1,
        size: 1
      };
    }
github nteract / nteract / src / notebook / components / cell / markdown-cell.js View on Github external
constructor(props: Props): void {
    super(props);
    this.shouldComponentUpdate = shouldComponentUpdate.bind(this);
    this.state = {
      view: true,
      // HACK: We'll need to handle props and state change better here
      source: this.props.cell.get('source'),
    };
    this.openEditor = this.openEditor.bind(this);
    this.editorKeyDown = this.editorKeyDown.bind(this);
    this.renderedKeyDown = this.renderedKeyDown.bind(this);
  }
github expo / ex-navigation / src / navigation-experimental / NavigationHeader.js View on Github external
shouldComponentUpdate(nextProps: Props, nextState: any): boolean {
    return ReactComponentWithPureRenderMixin.shouldComponentUpdate.call(
      this,
      nextProps,
      nextState
    );
  }
github ihmeuw / ihme-ui / src / ui / axis-chart / src / axis-chart.jsx View on Github external
shouldComponentUpdate(nextProps, nextState) {
    return !nextProps.loading && PureRenderMixin.shouldComponentUpdate(this, nextProps, nextState);
  }
github younth / react-router-redux-mobile-spa / app / router.jsx View on Github external
constructor(props, context) {
        super(props, context);
        this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
        this.updateHandle = this.updateHandle.bind(this)
    }
github younth / react-router-redux-mobile-spa / app / containers / App.jsx View on Github external
constructor(props, context) {
        super(props, context);
        this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
        this.state = {}
    }
github younth / react-router-redux-mobile-spa / app / containers / 404.jsx View on Github external
constructor(props, context) {
        super(props, context);
        this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
    }
    render() {
github keyz / repo.cat / src / components / PureComponent / PureComponent.js View on Github external
constructor(...args) {
    super(...args);
    this.shouldComponentUpdate = shouldComponentUpdate.bind(this);
  }
}
github draft-js-plugins / draft-js-plugins / site / components / CodeHighlight / index.js View on Github external
default as ReactComponentWithPureRenderMixin,
} from 'react-addons-pure-render-mixin';

import Prism from 'prismjs';

export default class Code extends Component {
  static propTypes = {
    className: PropTypes.string,
    code: PropTypes.string,
  };

  componentDidMount() {
    this._highlight();
  }

  shouldComponentUpdate = ReactComponentWithPureRenderMixin.shouldComponentUpdate;

  componentDidUpdate() {
    this._highlight();
  }

  _highlight() {
    Prism.highlightElement(this.refs.code);
  }

  render() {
    const className = (this.props.language ? `language-${this.props.language}` : '');
    return (
      <code></code>

react-addons-pure-render-mixin

>**Note:** >This is a legacy React addon, and is no longer maintained. > >We don't encourage using it in new code, but it exists for backwards compatibility. >The recommended migration path is to use [`React.PureComponent`](https://facebook.github.io/re

MIT
Latest version published 3 years ago

Package Health Score

80 / 100
Full package analysis