mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
[react-packager][streamline oss] Move open sourced JS source to react-native-github
This commit is contained in:
25
Libraries/Components/StaticRenderer.js
Normal file
25
Libraries/Components/StaticRenderer.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* 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;
|
||||
Reference in New Issue
Block a user