I am using jointJS as a diagramming library. It creates nodes on a graph using svg elements.
I want to use react to render the content of those nodes, and since jointJS lets me configure what svg element i want it to use, all I have to do is
- Configure jointJS so it knowns a node is a
<foreignObject> - Retrieve that foreign object, and mount a react component inside of it using
createPortal - Dynamically size the foreign object so it fits the react component.
It works fine, but I don't have enough experience with foreignObject to know if any caveats are to be expected.
Can anyone provide some feedback about their experience with such practices ?