/*global hljs*/ import React from 'react'; import PropTypes from 'prop-types'; class SourceArea extends React.Component { constructor(props) { super(props); this.state = { sourceCode: "" }; } componentDidMount() { let colorCodedText = hljs.highlight('javascript', this.props.source, true).value; this.setState({sourceCode: colorCodedText}); } render() { return

{this.props.definition.className}

{this.props.definition.filename}

      
; } } SourceArea.propTypes = { definition: PropTypes.object, source: PropTypes.string }; export default SourceArea;