Codemirror initial value support

This commit is contained in:
Gregory Schier
2023-02-24 16:43:47 -08:00
parent a77e378730
commit 2b92b7ab01
4 changed files with 71 additions and 57 deletions

View File

@@ -3,15 +3,12 @@ import './Editor.css';
interface Props {
contentType: string;
value: string;
initialValue?: string;
value?: string;
onChange?: (value: string) => void;
}
export default function Editor(props: Props) {
const { ref } = useCodeMirror({
value: props.value,
contentType: props.contentType,
onChange: props.onChange,
});
const { ref } = useCodeMirror(props);
return <div ref={ref} className="cm-wrapper" />;
}