Use the SplitEditor component for linked editor instances
mainThe split component (imported as SplitEditor) allows you to create multiple linked instances of the Ace editor. All instances share the same theme and other properties, but maintain their own independent values. This is useful for viewing different parts of the same content or managing multiple synchronized views.
import React from "react";
import { render } from "react-dom";
import { split as SplitEditor } from "react-ace";
import "ace-builds/src-noconflict/mode-java";
import "ace-builds/src-noconflict/theme-github";
// Render editor
render(
<SplitEditor
mode="java"
theme="github"
splits={2}
orientation="below"
value={["hi", "hello"]}
name="UNIQUE_ID_OF_DIV"
editorProps={{ $blockScrolling: true }}
/>,
document.getElementById("example")
);