var React = require('react') module.exports = React.createClass({ getInitialState: function(){ return { lib: false } }, componentDidMount: function(){ require.ensure(['react-markdown'],_ => { if(this.isMounted()) this.setState({ MarkdownLib: require('react-markdown') }) }) }, renderIfApplicable: function(){ if(this.props.source){ if(this.state.MarkdownLib){ var MarkdownLib = this.state.MarkdownLib return } else { return

{this.props.source}

} } else return

...

}, render: function(){ return this.renderIfApplicable() } })