Bones/node_modules/bs-recipes/recipes/webpack.preact-hot-loader/app/js/main.js
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00

17 lines
342 B
JavaScript

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();