You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating callbacks inside the html! macro, you can use tuple-function syntax (eg: callback=Some if Option<_> is the component's message type) instead of providing a normal closure (eg callback=|x| Some(x)) when you create components.
For some reason, this isn't possible for event handlers in Vtags. where oninput=Some will cause the html! macro to complain about it expecting a closure in the form of |_| Etc...
I don't see an immediate reason why this syntax couldn't be supported and I think the proc macro is being a little too conservative.
This strikes me as a regression because I thought this might have been possible at some point, but I can't recall exactly when it happened. I lack specific examples, but will update this issue as I find more specific information.
The text was updated successfully, but these errors were encountered:
I see that this is fine given that oninput=self.link.callback(Some) should now work. Granted, you are typing more characters, but at least "tuple-functions" should work as intended in both vtags and components.
Close this upon completion of #756.
Description
I'm submitting a bug report/feature
When creating callbacks inside the
html!
macro, you can use tuple-function syntax (eg:callback=Some
ifOption<_>
is the component's message type) instead of providing a normal closure (egcallback=|x| Some(x)
) when you create components.For some reason, this isn't possible for event handlers in
Vtag
s. whereoninput=Some
will cause the html! macro to complain about it expecting a closure in the form of|_| Etc..
.I don't see an immediate reason why this syntax couldn't be supported and I think the proc macro is being a little too conservative.
This strikes me as a regression because I thought this might have been possible at some point, but I can't recall exactly when it happened. I lack specific examples, but will update this issue as I find more specific information.
The text was updated successfully, but these errors were encountered: