Skip to content

Allow property passthrough #570

@watzon

Description

@watzon

Feel free to retitle this if you can think of something more descriptive. Essentially it would be nice to be able to pass through properties from a parent component to a child component without having to individually pass through each one. For instance:

component Bar {
  property baz : String
  
  fun render : Html {
    <div>{ baz }</div>
  }
}

component Foo {
  fun render : Html {
    <Bar {...properties} />
  }
}

Granted this a terrible example and not showing a real world use case, but I think the {...properties} way would be one way to handle it. For a real world use case you can check out my mint-tabler library which includes 3100+ generated components which follow a common template and need to pass properties into a child component.

I would agree that this is normally an anti-pattern and can definitely be relied on the wrong way, but in certain situations (like mine), it could very well make the library considerably smaller.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions