pure-render-mixin
v1.0.2
Published
Facebook's PureRenderMixin for React as an isolated module
Downloads
517
Maintainers
Readme
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;