Skip to content

Instantly share code, notes, and snippets.

@ar5had
Forked from alexeisavca/ReactIgnore
Created July 25, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ar5had/5c13dad95bfe6f3b8ce41b846cd38f7d to your computer and use it in GitHub Desktop.
Save ar5had/5c13dad95bfe6f3b8ce41b846cd38f7d to your computer and use it in GitHub Desktop.
A simple component to make ReactJs ignore subtrees
var React = require('react/addons');
var ReactIgnore = {
displayName: 'ReactIgnore',
shouldComponentUpdate (){
return false;
},
render (){
return React.Children.only(this.props.children);
}
};
module.exports = {
Class: ReactIgnore,
Component: React.createClass(ReactIgnore)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment