How well does it work for complex projects/component libraries? React is a pain in the ass but there's at least some established patterns for large projects.
If you're lucky your chosen language enables you to do that inlined in your function along with your normal workflow. Otherwise you now have template files, templating logic and domain logic across several files and you're right back where you started (accidental complexity), minus the JS.