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
Reality: <MyComponent callback={|_| ...}>, where Props { callback: Callback<()> } leads to IntoPropValue<yew::Callback<()>> is not implemented for [closure@src/ui.rs:15:35: 15:75]. Manually wrapping closure in Callback::from is a workaround.
Details about the solution you'd like(Optional)
Ideally, passing closures to props of type Callback<_> would be supported, for components, not just elements.
I've shamelessly copied your hypothetical implementation, and adaptations of it for the other two cases, into a pull request to hopefully expedite this 😂
…roperties (#2554)
* Fix#2553 - automatically convert closure to callback for component properties.
* Support F -> Option<Callback<_>> too.
* test stderr.
This is about:
Problem
Documentation:
Reality:
<MyComponent callback={|_| ...}>
, whereProps { callback: Callback<()> }
leads toIntoPropValue<yew::Callback<()>> is not implemented for [closure@src/ui.rs:15:35: 15:75]
. Manually wrapping closure inCallback::from
is a workaround.Details about the solution you'd like (Optional)
Ideally, passing closures to props of type
Callback<_>
would be supported, for components, not just elements.Additional context (Optional)
https://discord.com/channels/701068342760570933/703449306497024049/957453333403152385
In particular, WorldSEnder wrote
Questionaire (Optional)
The text was updated successfully, but these errors were encountered: