|
|
|
|
|
by orenelbaum
1571 days ago
|
|
This is another area where Solid has an advantage over React. With React you could use Hyperscript functions so the above JSX would be 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. |
|