Skip to content
Snippets Groups Projects
index.ts 502 B
Newer Older
/**
 * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
 *
 * @author David Sehnal <david.sehnal@gmail.com>
 */

David Sehnal's avatar
David Sehnal committed
import { PluginContext } from './context';
import { Plugin } from './ui/plugin'
import * as React from 'react';
import * as ReactDOM from 'react-dom';

export function createPlugin(target: HTMLElement): PluginContext {
    const ctx = new PluginContext();
    ReactDOM.render(React.createElement(Plugin, { plugin: ctx }), target);
    return ctx;
}