react-drawio
react-drawio copied to clipboard
Expose export options as DrawIoEmbed props
Thank you for this! Nicely written and fitted my use case perfectly. Well almost – I think the export options in exportDiagram method could be exposed as a prop on DrawIoEmbed so we can just rely on the internal draw.io Save button and the onSave listener to get the exported data with those options set.
Hi @membla,
As far as I can see, draw.io doesn't support a thing like this. I think it would be best to trigger drawioRef.current.exportDiagram with the necessary arguments when onSave is triggered. Would that work for you?
Hi @marcveens
I didn't mean as options to draw.io but as props to the component for your internal state.
In our setup with noSaveBtn: true we get two action buttons in the Draw.io top bar – "Save & Exit" and "Exit". Clicking "Save & Exit" will trigger onSave just as exportDiagram will, so it will unless otherwise handled lead an infinite loop.
As exportFormat for the export action is exposed as a prop to the component – could the other arguments not also be exposed?