Syntax highlighting component based on react-syntax-highlighter development.
npm install react-highlight-codeblock --save
import CodeBlock from 'react-highlight-codeblock'
<CodeBlock
code={strCode}
callback={code => console.log(code)}
editer={true}
language="html"
style="monokai"
showLineNumbers={false}
/>code- code snippet presentation and editing.editer- default to false, is it editable.style- the style to highlight code in. Available options here for hljs.do not use the default style.language- the language to highlight code in. Available options here for hljs .callbackis used with theediterattribute as a post-edit callback function.showLineNumbersif this is enabled line numbers will be shown next to the code block.