Okay, uh *rubbing eyes* Rust question I'm looking at the library yew_hooks I cop...

@mcc@mastodon.social

Okay, uh *rubbing eyes* Rust question

I'm looking at the library yew_hooks

I copypaste this sample code.

docs.rs/yew-hooks/0.6.4/yew_ho

on my call

yew_hooks::use_effect_once(|| { // Connect
...
});

I get the error

expected an `FnOnce()` closure, found `()`

…huh?

If I change my call to

yew_hooks::use_effect_once(|| { // Connect
...
|| {}
});

It works.

???

Furthermore, there's a (EffectOnce) tag on the component macro, whose presence or absence seems to change nothing.

[Post 1 of 2]