Last active
June 13, 2017 14:17
-
-
Save shalkam/2533381e66c6de27e621247b2ed607b0 to your computer and use it in GitHub Desktop.
Using Markdown inside React.js
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 React, { Component } from 'react'; | |
import Markdown from 'markdown-to-jsx'; | |
import content from 'readme.md'; // Webpack should be configured to handle loading .md files (using raw-loader may be) | |
export default class Readme extends Component { | |
render() { | |
return ( | |
<Markdown> | |
{content} | |
</Markdown> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment