1
0
mirror of synced 2025-12-20 10:28:40 -05:00
Files
docs/react/CodeBlock.js
Chiedo b781e43893 Add experimental react support within markdown
Also added fronmatter for interactive: true to turn on React on a file by file
basis and prevent slowing down the builds for non-react files
2020-10-18 14:44:34 -04:00

15 lines
362 B
JavaScript

const React = require('react')
const ReactDOM = require('react-dom')
const { Prism } = require('react-syntax-highlighter')
const { dark } = require('react-syntax-highlighter/dist/cjs/styles/prism')
const CodeBlock = (props) => {
return (
<Prism language={props.language} style={dark}>
{props.children}
</Prism>
)
}
module.exports = CodeBlock