A simple wrapper to easily add GitHub's markdown editor and viewer to your React applications.
npm install react-github-markdown
import React from 'react';
import { MarkdownEditor, MarkdownViewer } from 'react-github-markdown';
const App = () => {
const [markdown, setMarkdown] = React.useState('');
return (
<div>
<MarkdownEditor
value={markdown}
onChange={setMarkdown}
/>
<MarkdownViewer markdown={markdown} />
</div>
);
};
This project uses -
- MarkdownEditor & MarkdownViewer components from GitHub's Primer React Library. Checkout, and contribute to Primer React Repository.
- Markdown styling is imported from sindresorhus/github-markdown-css