retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.17k stars 653 forks source link

Possible to Wrap the Editor in a React Component? #433

Closed JUSTINMKAUFMAN closed 4 years ago

JUSTINMKAUFMAN commented 4 years ago

I’m hoping to put the editor inside a react component that can be added to the DOM the React way. Is this possible?

Ni55aN commented 4 years ago

yes, you need a reference to HTML element with fixed sizes

Ni55aN commented 4 years ago

https://en.reactjs.org/docs/refs-and-the-dom.html

  componentDidMount() {
    createEditor(this.ref); // create `createEditor` method that accepts a container for editor 
  }