From 6db07f566b21cbad2cd3d7dcaa0d9650c1eff5fe Mon Sep 17 00:00:00 2001 From: Ryan Fischbach Date: Thu, 16 May 2024 14:33:26 -0700 Subject: [PATCH] ReactDOM.render() has a special return ref mechanism. --- src/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index ae6b3041..460cd3e5 100644 --- a/src/index.js +++ b/src/index.js @@ -23,12 +23,14 @@ window.showFlowEditor = (ele, config) => { if (config.httpTimeout) { setHTTPTimeout(config.httpTimeout); } - //<*((==< + //<*((==< pass in extra schemes if (Array.isArray(config.schemes)) { concatSCHEMES(config.schemes); } - - return ReactDOM.render(, ele); + //<*((==< return the instance reference + const theFlowEditor = userRef(null); + ReactDOM.render(, ele); + return theFlowEditor; }; // If you want your app to work offline and load faster, you can change