React.createElement('div', null, `The count is: {this.state.count}`).
With Solid you get the choice, you could use JSX, Hyperscript functions or template literals like in your example. Solid does recommend using JSX because there are some tradeoffs to using template literals without compilation, but it still maintains almost all of its qualities AFAIK and in the big framework benchmark Solid with template literals is the fastest template literals implementation.
With Solid you don't even have to use any templating languages, you can take care of rendering yourself using the tools that the framework gives you. Solid at its core is more of a capable state management library similar to MobX but designed to be used as the only reactivity engine unlike MobX which is usually used on top of React.
If the state comes from the user, they
can add script tags into the html
How is that different with React?And how is it a problem? A rendering engine would set the html of some element to the html I think?
This ...
document.body.innerHTML='<script>alert(1)</script>';
...does not execute the script.https://developer.mozilla.org/en-US/docs/Web/API/Element/inn...
But the same issue with reacts way.
But you can do the same in Javascript:
Using regular Javascript makes my life a thousand times easier than having to go through a compiler to make things work in the browser.