Skip to content

Instantly share code, notes, and snippets.

@pgoldrbx
Created March 8, 2015 21:20
Show Gist options
  • Save pgoldrbx/dc2635c5940ea19c4995 to your computer and use it in GitHub Desktop.
Save pgoldrbx/dc2635c5940ea19c4995 to your computer and use it in GitHub Desktop.
'use strict';
var React = require('react');
var LazyLoad = React.createClass({
getInitialState: function () {
return {
ready: false
};
},
render: function () {
var content;
if (this.state.ready) {
content = this.props.children;
}
return (
<div class="lazy">
{content}
<noscript>
{this.props.children}
</noscript>
</div>
);
}
});
module.exports = LazyLoad;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment