molecule icon indicating copy to clipboard operation
molecule copied to clipboard

feat: multiple instances of Molecule

Open wewoor opened this issue 2 years ago • 0 comments

Description

The Molecule only supports the standalone currently, when you use the create() function, it just returns a global molecule instance. But some developers need to create multiple instances of Molecule in one page, like:


const moInstance1 = create({
    extensions: [],
});

const moInstance2 = create({
    extensions: [],
});

const App1 = () => moInstance.render(<Workbench />);

const App2 = () => moInstance2.render(<Workbench />);

// Do something
moInstance1.editor. open()
moInstance2.editor. open()

wewoor avatar Mar 17 '23 03:03 wewoor