-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
How to use Messages with wrapper components? #738
Comments
@mdtusz thanks for the report and apologies for the half-baked implementation. Soon I'll write up better documentation for this but as of right now: (From #589) Unsupported
Terminology(B) Base component that renders components nested inside each other |
I'll have to think more about a better way to handle this 😬 open to ideas! |
@mdtusz I've created a PR to fix this issue. Could you please try out the branch and let me know if it fixes your problem? |
Fixed by #783 |
Description
I'm submitting a question.
I'm trying to create some wrapper components that exist mostly for presentation and organization and have run into the issue that I can't make use of any events/messages in the child components since they are expecting the parent component's
Message
type. As a simple example:A
Foo
wrapper component that does nothing but wrap children in a div with a class.A
Bar
parent component withMessage = BarMsg
that wants to make use ofFoo
.This won't work unfortunately because the compiler demands the
onclick
for thebutton
's to be of the type specified for theFoo
component. The desired behaviour is to "bubble" the events/messages up to the parentBar
component that is making use of theFoo
component.I've tried out a few different things with type parameters on the
Foo
component in order to try and get the correctMessage
type, but can't seem to make it work.I'm thinking there may be some Type-Fu that I'm missing out on that will solve this, but it's no doubt an ergonomics issue for a fairly common pattern, so any help will be great and I'll be happy to make an example case for the repo if I can get things working.
The text was updated successfully, but these errors were encountered: