import React, { MouseEvent } from 'react'; import Marked from 'marked'; interface Props {} interface State { content: string; } class SMarkdown extends React.Component { constructor(props: Props) { super(props); this.state = { content: '' }; } componentDidMount() { const html = Marked('# Marked in browser\n\nRendered by **marked**.'); this.setState({ content: html }); } render() { const { content } = this.state; return (
); } } export default SMarkdown;