cferdinandi / reef

A lightweight library for creating reactive, state-based components and UI.

Home Page:https://reefjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Component composition

stephanebisson opened this issue · comments

Is there a way to do component composition, defining smaller components to be used within larger components?

For example, is it currently possible to refactor the To-do app into a structure of components like this, each with its own rendering logic and events handling:

  • TodoApp
    • TodoList
      • TodoItem
    • TodoForm

No there's not (by design). You can use nested functions that return HTML strings to provide a bit more structure to your code if you'd like, but this library is deliberately different from how something like Vue or React might handle UI.