Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't agree that you need React or a vdom for composability. I remember a lot of server-side libraries with an API something like

    html(
      body(
        div(
          p("hello world"),
          class: "blah"
        )
      )
    )
where the tree was built using function calls. In such a system, HTML was often represented by an AST (or just a wrapper around a string!) and you could compose HTML together just by creating and calling a function.

This is what JSX/TSX are doing under the hood: they're transpiled to a call to React.createElement. You don't actually need them, though.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: