developit / htm

Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
Apache License 2.0
8.64k stars 169 forks source link

Dynamic Loading? #223

Closed renhiyama closed 2 years ago

renhiyama commented 2 years ago

Currently its not possible to run htm like this:

htm`${"<p>hello</p>"}`

making it hard for me to dynamically load jsx over the internet.

GjeloshajAntoine commented 2 years ago

Shouldn't you call it like a function such as htm("<p>hello</p>") ?

renhiyama commented 2 years ago

@GjeloshajAntoine that's not possible, htm uses template string functions so you can't use () but you need to use ` `. Anyways I would like to close this issue since I've made dynamic loading, and it will be available as a framework soon at https://github.com/rovelstars/reejs (Currently it doesn't supports other sites, but I will rewrite it soon to make that happen 😄)