Skip to content

jiakun-zhao/rehype-jsx

Repository files navigation

rehype-jsx

npm version

rehype plugin to JSX.

Install

npm install rehype-jsx

Usage

import rehype from 'rehype'
import rehypeJsx from 'rehype-jsx'

rehype()
  .data('settings', { fragment: true })
  .use(rehypeJsx)
  .process('<div>Hello World</div>')
  .then(({ value }) => {
    console.log(value) // <><div>{"Hello World"}</div></>;
  })

License

MIT