You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
371 B
JavaScript
12 lines
371 B
JavaScript
import { registerCodeHighlighting } from "@lexical/code";
|
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
import { useEffect } from "react";
|
|
|
|
export default function CodeHighlightPlugin() {
|
|
const [editor] = useLexicalComposerContext();
|
|
useEffect(() => {
|
|
return registerCodeHighlighting(editor);
|
|
}, [editor]);
|
|
return null;
|
|
}
|