-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does this library exist? #38
Comments
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. |
For me, one reason is that template strings lack strong type. For example: function myComponent(props) {
return `<div>${props.name}</di>` // <-- Here is a spelling mistake, but it is not easily noticeable.
} jsx function myComponent(props) {
return <div>{props.name}</di> // <-- When using jsx , it will raise an error.
} |
@zuisong Some kind of linter in your editor can tell you that, no need for JSX or Babel or any other garbage like that. |
it sanitizes text. |
You can have components and create really complex HTML with it. With template literal you only can create simple examples. |
It's also great for debugging JSX libraries (if it would work correctly). |
You use JSX syntax and helpers that you can't use with template literals... 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... Note this vhtml library can also be used with template literals along with htm that kindof brings some JSX shothands to template literals ;) |
Why does this library exist when you can just use template strings?
The text was updated successfully, but these errors were encountered: