You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree. It would be good to explain in the README if there are reasons I'm unaware of. I'm using typescript files to convert to individual javascript files for an MVC app with no React and wanted to use this plugin in my gulp/webpack setup, but then I thought to just use template strings instead.
You use JSX syntax and helpers that you can't use with template literals...
Like binding event handlers, or attributes as object.
This is a matter of choice, sugar vs vanilla...
You can not say that this library is useless! It permit to use JSX syntax but not along with p?react or any other Rube Goldberg machine...
JSX became used everywhere nowadays (some newbies front devs don't know that HTML in js is not a standard 😂)
Note this vhtml library can also be used with template literals along with htm that kindof brings some JSX shothands to template literals ;)
Activity
Mike-Logit commentedon Jun 21, 2023
I agree. It would be good to explain in the README if there are reasons I'm unaware of. I'm using typescript files to convert to individual javascript files for an MVC app with no React and wanted to use this plugin in my gulp/webpack setup, but then I thought to just use template strings instead.
zuisong commentedon Jul 13, 2023
For me, one reason is that template strings lack strong type.
For example:
jsx
eldoy commentedon Jul 15, 2023
@zuisong Some kind of linter in your editor can tell you that, no need for JSX or Babel or any other garbage like that.
catdevnull commentedon Aug 3, 2023
it sanitizes text.
jcubic commentedon Dec 30, 2023
You can have components and create really complex HTML with it. With template literal you only can create simple examples.
jcubic commentedon Mar 23, 2024
It's also great for debugging JSX libraries (if it would work correctly).
devingfx commentedon Nov 6, 2024
You use JSX syntax and helpers that you can't use with template literals...
Like binding event handlers, or attributes as object.
This is a matter of choice, sugar vs vanilla...
You can not say that this library is useless! It permit to use JSX syntax but not along with p?react or any other Rube Goldberg machine...
JSX became used everywhere nowadays (some newbies front devs don't know that HTML in js is not a standard 😂)
Note this vhtml library can also be used with template literals along with htm that kindof brings some JSX shothands to template literals ;)