npm i prismjs
npm i -D @types/prismjs
import React, { useEffect } from 'react'
import Prism from 'prismjs'
import 'prismjs/components/prism-javascript' // Language
import 'prismjs/themes/prism-okaidia.css' // Theme
function App() {
// Init
useEffect(() => {
Prism.highlightAll()
}, [])
// Usage
return (
<div className="App">
<pre>
<code className="language-javascript">
<div> Markup here... </div>
</code>
</pre>
</div>
)
}
export default App