npm i react-prism-code
<Code lang="jsx">{`import { Code, InlineCode } from "react-prism-code";
import "prismjs/themes/prism-solarizedlight.css";
import "prismjs/components/prism-jsx"; // 默认只有 markup, css, clike and javascript
function Hello() {
return <h2>React typescript</h2>
}`}</Code>
output
import { Code, InlineCode } from "react-prism-code";
import "prismjs/themes/prism-solarizedlight.css";
import "prismjs/components/prism-jsx"; // 默认只有 markup, css, clike and javascript
function Hello() {
return <h2>React typescript</h2>
}