4 ms·
> mixes UI snippets with code You can never really avoid it unless you only use HTML. Templates are code. I think JSX is nicer because it's fully featured and
by triyambakam 4y ago
> mixes UI snippets with code
You can never really avoid it unless you only use HTML. Templates are code. I think JSX is nicer because it's fully featured and the same syntax as regular JS, not a subset limited template language
- crabmusket 4y agoI haven't used Twig, but have used other PHP templating engines. Scope is the big deal for me. JSX has actual scoping (it's just JavaScript), function calls, etc. PHP templates have one scope, even when you enter an included sub template. Laravel released template components in version 7, but I haven't been able to try them yet and I'm hoping they'll improve things.