Skip to content

Instantly share code, notes, and snippets.

@jordanell
Created May 28, 2020 16:53
Show Gist options
  • Save jordanell/615439d48e3275c9a11b954bb4b53141 to your computer and use it in GitHub Desktop.
Save jordanell/615439d48e3275c9a11b954bb4b53141 to your computer and use it in GitHub Desktop.
React to Markdown demo component
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