Skip to content

Instantly share code, notes, and snippets.

@shalkam
Last active June 13, 2017 14:17
Show Gist options
  • Save shalkam/2533381e66c6de27e621247b2ed607b0 to your computer and use it in GitHub Desktop.
Save shalkam/2533381e66c6de27e621247b2ed607b0 to your computer and use it in GitHub Desktop.
Using Markdown inside React.js
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