react-native/Libraries/Components/StaticRenderer.js

26 lines
486 B
JavaScript
Raw Normal View History

2015-01-30 01:10:49 +00:00
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @provides StaticRenderer
*/
'use strict';
var React = require('React');
var StaticRenderer = React.createClass({
propTypes: {
shouldUpdate: React.PropTypes.bool.isRequired,
render: React.PropTypes.func.isRequired,
},
shouldComponentUpdate: function(nextProps) {
return nextProps.shouldUpdate;
},
render: function() {
return this.props.render();
},
});
module.exports = StaticRenderer;