mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 23:43:55 +01:00
Codemirror initial value support
This commit is contained in:
@@ -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" />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user