pure-render-decorator
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -27,2 +27,3 @@ /** | ||
component.prototype.shouldComponentUpdate = shouldComponentUpdate; | ||
return component; | ||
} | ||
@@ -29,0 +30,0 @@ |
{ | ||
"name": "pure-render-decorator", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Makes React components pure.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,2 +6,4 @@ Pure render decorator | ||
[![Build Status](https://travis-ci.org/felixgirault/pure-render-decorator.svg?branch=master)](https://travis-ci.org/felixgirault/pure-render-decorator) | ||
Installation | ||
@@ -22,5 +24,5 @@ ------------ | ||
@pureRender | ||
class Test extends Component { | ||
export default class Test extends Component { | ||
render() { | ||
return <div></div>; | ||
return <div />; | ||
} | ||
@@ -46,1 +48,16 @@ } | ||
``` | ||
As decorators are simply functions, you can also use `pureRender()` without the decorator syntax: | ||
```jsx | ||
import {Component} from 'react'; | ||
import pureRender from 'pure-render-decorator'; | ||
class Test extends Component { | ||
render() { | ||
return <div />; | ||
} | ||
} | ||
export default pureRender(Test); | ||
``` |
@@ -47,2 +47,10 @@ /** | ||
}); | ||
/** | ||
* | ||
*/ | ||
it('should return the component', function() { | ||
var c = function() {}; | ||
assert.equal(c, decorate(c)); | ||
}); | ||
}); |
4832
7
73
61