Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow property passthrough #570

Open
watzon opened this issue Jan 4, 2023 · 0 comments
Open

Allow property passthrough #570

watzon opened this issue Jan 4, 2023 · 0 comments
Labels

Comments

@watzon
Copy link

watzon commented Jan 4, 2023

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.

@Sija Sija added language Language feature feature request labels Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants