uiwjs / react-md-editor

A simple markdown editor with preview, implemented with React.js and TypeScript.
https://uiwjs.github.io/react-md-editor
MIT License
2.17k stars 156 forks source link

Can not access commandOrchestrator anywhere since v2 #150

Closed chinfeng closed 3 years ago

chinfeng commented 3 years ago

Is this feature miss since v2 ? I can not access commandOrchestrator anywhere since v2. I worked under v1.

const r = useRef();
function exec() {
  if (r.current) {
    r.current.commandOrchestrator.executeCommand({ execute(state, api) { /* ... */ } });
  }
}
return (
  <>
    <button onClick={exec}>execute command from here</button>
    <MDEditor ref={r}/>;
  </>
)
jaywcjlove commented 3 years ago

image

Upgrade + @uiw/react-md-editor@3.0.7