main.js 342 B

12345678910111213141516
  1. import {h, render} from 'preact';
  2. if (module.hot) {
  3. module.hot.accept('./HelloWorld.jsx', () => requestAnimationFrame(() => {
  4. init();
  5. }));
  6. }
  7. let root;
  8. function init() {
  9. const HellowWorld = require('./HelloWorld.jsx').default;
  10. root = render(<HellowWorld />, document.getElementById('preact-root'), root);
  11. }
  12. init();