-
import Content from '!babel-loader!@mdx-js/loader!./content.mdx'
export default function App() {
return <Content components={{code}}/>
}
function code({className, ...props}) {
alert("s");
const match = /language-(\w+)/.exec(className || '')
return match
? <SyntaxHighlighter language={match[1]} PreTag="div" {...props} />
: <code className={className} {...props} />
} I made this code by referring to the official document. |
Beta Was this translation helpful? Give feedback.
Answered by
wooorm
Dec 30, 2021
Replies: 1 comment 3 replies
-
See the note at the top of the website: it’s for MDX 2, which you can install with |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
ChristianMurphy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the note at the top of the website: it’s for MDX 2, which you can install with
@next