1.0.2 • Published 9 years ago

pure-render-mixin v1.0.2

Weekly downloads
23
License
MIT
Repository
github
Last release
9 years ago

PureRenderMixin

Facebook's PureRenderMixin for React as an isolated module. Read Facebook's write up on why this is useful for increasing react component rendering performance.

Installation

  npm install pure-render-mixin

Usage

Instructions taken verbatim from Facebook's pure-render-mixin page.

var PureRenderMixin = require('pure-render-mixin').PureRenderMixin;
React.createClass({
  mixins: [PureRenderMixin],

  render: function() {
    return <div className={this.props.className}>foo</div>;
  }
});

For convenience bashallowCompare and bashallowEqual are exported for creating variants of this implementation for special cases:

var shallowCompare = require('pure-render-mixin').shallowCompare;
var shallowEqual = require('pure-render-mixin').shallowEqual;