GitHub

Inline markdown for #ReactJS / JSX:

  • You can use custom components for markdown primitives like so –
  • zero-overhead markdown in your react components
  • import markdown from ‘ markdown-in-js ‘ const App = () => markdown ` ## This is some content.
  • add ‘markdown-in-js/babel’ to the plugins field of your babel config
  • optionally add prismjs for syntax highlighting of code blocks

markdown-in-js – inline markdown for react/jsx

@ReactiveConf: Inline markdown for #ReactJS / JSX:

We recommend upgrading to the latest Safari, Google Chrome, or Firefox.

import markdown from ‘markdown-in-js’ const App = () => markdown ` ## This is some content. You can write _markdown_ as you’d like. ${ interpolate more } you can inline *html* or even , wow

interpolate attributes as expected

`

import md from ‘markdown-in-js’ import { MyHeading, MyLink } from ‘./path/to/components’ const App = () => md({ h1: MyHeading, a: MyLink })` # this will be a custom header [custom link component](/url/to/link) `

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

GitHub