[yew-devel] [PATCH yew-widget-toolkit] props: replace `BuilderFn` with `RenderFn`
Dominik Csapak
d.csapak at proxmox.com
Fri Dec 12 08:31:21 CET 2025
On 12/11/25 2:50 PM, Dietmar Maurer wrote:
>
> I think this was the reason I invented the whole thing.
>
> > The only slightly awkward changes are: * we now have to use
> `apply(&())` in this case * when giving a callback to such a builder we
> have to use `|_: &_|` now, but this was also the case for any closure
> that got converted into a `RenderFn`.
>
> Being forced to use |_: &_| is ugly, and the compiler errors for that
> are even more ugly and confusing. So I am not sure about this change.
>
as i wrote this is already the case for every user of the RenderFn, and
we only use the BuilderFn internally in pwt currently and only in three
places, so I don't think that this is too bad.
On 12/11/25 2:54 PM, Dietmar Maurer wrote:
>
> I thought we can simply use Callback to replace BuilderFn?
i tried, but this would result in other weird usage, e.g.
we'd have to use `emit(())` instead if `apply(&())` which
is also not very intuitive.
also there is no 'into trait' for callbacks with a generic
return value AFAICS
but as discussed off-list, let's wait for yew 0.22 which
introduces a `CallbackRef` that seemingly does something
very similar to our `RenderFn`, then we can maybe
get rid of both RenderFn and BuilderFn
More information about the yew-devel
mailing list