How to use the htm/preact.render function in htm

To help you get started, we’ve selected a few htm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kahlil / grit-preact / src / renderer.js View on Github external
mousetrap.bind('command+u', () => dispatch({ type: 'publishBlog' }));
mousetrap.bind('command+,', () => dispatch({ type: 'openSettings' }));
if (isDev) {
  mousetrap.bind('command+alt+e', () => global.electronStore.clear());
}

// Fire actions from main process.
ipcRenderer.on('action', (_, action) => {
  dispatch(action);
});

// Run side effects.
effects.run(appRoot);

// Render the app.
render(
  html`
    <${App} />
  `,
  appRoot
);
github vesparny / markeye / renderer.js View on Github external
}
      )
    })
  }

  render (props, { markdown }) {
    return html`
      <div class="markdown-body">
    `
  }
}

render(
  html`
    &lt;${App} /&gt;
  `,
  document.body
)
</div>

htm

The Tagged Template syntax for Virtual DOM. Only browser-compatible syntax.

Apache-2.0
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis

Popular htm functions