Newer
Older
vmk-demo-bot / admin / node_modules / bs-recipes / recipes / webpack.preact-hot-loader / app / js / main.js
@eugene-sukhodolskiy eugene-sukhodolskiy on 15 Jul 342 bytes init
import {h, render} from 'preact';

if (module.hot) {
    module.hot.accept('./HelloWorld.jsx', () => requestAnimationFrame(() => {
        init();
    }));
}

let root;

function init() {
    const HellowWorld = require('./HelloWorld.jsx').default;
    root = render(<HellowWorld />, document.getElementById('preact-root'), root);
}

init();