Codemirror initial value support

This commit is contained in:
Gregory Schier
2023-02-24 16:43:47 -08:00
parent 7dea1b7870
commit 72486b448c
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" />;
}