Creating editor in 1 centrelized place and referencing - React

I am rendering the editor inside a table, in all the columns in a cell. I want to create it in 1 place and reference it.
Once i click on the cell i want the editor to open with the current cell data inside a popup in a changing size.
How can i do that without Create and Destroy the editor every time and just create an instance and use the same on every time?
I am using react.
ScreenRecording2024-05-01at14.03.35-ezgif.com-video-to-gif-converter

Try createPortal – React

Take with a grain of salt I don’t know React.

You should be able to just move the editor’s DOM element somewhere, possibly following up with a requestMeasure() call if the new DOM position changes its dimensions or styles.

But given that you’ll probably want a fresh editor state with new content and a separate undo history, creating a new editor is probably easier and just as fast.

hi @marijn thanks for the reply.
I am wondering about the performance of creating and deleting
Wouldn’t it be faster to set the state of the editor and render it instead of creating and destroying? If setting editor state is fast then it should be much faster no?
Thanks ahead!