Created
May 28, 2020 16:53
-
-
Save jordanell/615439d48e3275c9a11b954bb4b53141 to your computer and use it in GitHub Desktop.
React to Markdown demo component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PropTypes from "prop-types"; | |
import React from "react"; | |
import MarkdownElement from "src/modules/components/MarkdownElement"; | |
import Sandbox from "src/modules/components/Sandbox"; | |
class Demo extends React.Component { | |
static propTypes = { | |
demo: PropTypes.object.isRequired | |
}; | |
render() { | |
const { demo } = this.props; | |
return ( | |
<React.Fragment> | |
<Sandbox component={demo.jsx} name={demo.name} /> | |
<MarkdownElement text={`\`\`\`\n${demo.rawJS}\n\`\`\``} /> | |
</React.Fragment> | |
); | |
} | |
} | |
export default Demo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment