|
|
|
|
|
by zdragnar
1407 days ago
|
|
Think of JSX as a macro, rather than "regular" templating, which is typically string substitution. For static sites, this means that you get functions and objects the entire way through the render pipeline right up until there is a full tree built and the final output is rendered. You still get all the separation powers of contexts, the component based reusability, etc, and it is all regular JavaScript / typescript except for the JSX macro itself and React's APIs (which are just JavaScript). Conversely, with templating engines like handlebars / erb / et al you need to learn the specific DSL of the template engine- custom loops and controls, imports for partials, and your custom helpers are limited to what they can do. Even Vue's render function has special markup for control (v-if, v-else). |
|