pure-render-mixin

1.0.2 • Public • Published

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 shallowCompare and shallowEqual 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;

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i pure-render-mixin

    Weekly Downloads

    34

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • francoislaberge