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
15 lines
362 B
JavaScript
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
|