DEV Community

loading...

Discussion on: Rails to Introduce View Components

Collapse
jleblanc profile image
Josh LeBlanc

In composition? All the time.

If everything is decorating each other, you can get many levels very quickly. Take a list for example.

List

  • ListItem
    • ListItemAvatar
      • Avatar
    • ListItemText
      • ListItemPrimaryText

You're at 4 levels deep just from a list. That component would live in some other component, which would probably live in some other component, up until you reach the actual top level component. You could easily reach 10 levels.

Forem Open with the Forem app