Open divyamohanraju07 opened 1 year ago
import CodeMirrorMerge from "react-codemirror-merge";
import "./styles.css";
import { EditorView } from "@codemirror/view";
import { EditorState } from "@codemirror/state";
import { githubLight } from "@uiw/codemirror-theme-github";
const Original = CodeMirrorMerge.Original;
const Modified = CodeMirrorMerge.Modified;
const original_doc = `{\n one: to, \n three: four\n}`;
const modified_doc = `{\n One: Two, \n Three: Four\n}`;
export default function App() {
return (
<div className="App">
<CodeMirrorMerge theme={githubLight} orientation="b-a">
<Original value={original_doc} />
<Modified
value={modified_doc}
extensions={[
EditorView.editable.of(false),
EditorState.readOnly.of(true)
]}
/>
</CodeMirrorMerge>
</div>
);
}
I am working in a project requirement where i need to compare the config files from different deployment environment. I was searching for a difference editor and finalised with codemirror. My data to handle is in json format. When i load it in codemirror merge, my screen is blank with no error indication. I do not know where should i indicate the lang support. Any help here would be gr8.