Closed ghost closed 11 months ago
The Yew version needs to be updated. Should have some time soon to release a fix
The Yew version needs to be updated. Should have some time soon to release a fix
From what I found out, updating yew
to v0.21.0
is not going to be enough.
There has been some breaking changes, see: yewstack/yew#3289.
I'm receiving other error, let me quickly give a sample:
#[derive(Clone, Debug, Default, PartialEq, yewdux::store::Store)]
pub struct StateSprites(RefCell<HashMap<String, SpriteData>>);
pub enum SpritesManagerMsg {
SpritesInjected(Rc<StateSprites>),
}
pub struct SpritesManager {
_state_listener: Dispatch<StateSprites>,
state: Rc<StateSprites>,
element: Element,
}
impl SpritesManager {
const ID: &'static str = "svg-sprites";
}
impl yew::Component for SpritesManager {
type Message = SpritesManagerMsg;
type Properties = ();
fn create(ctx: &yew::Context<Self>) -> Self {
let cb = ctx.link().callback(Self::Message::SpritesInjected);
let dispatch = Dispatch::<StateSprites>::subscribe(cb);
// Redacted to for simplification
}
// Rest is redacted to for simplification
}
I'm receiving this error message on the:
let dispatch = Dispatch::<StateSprites>::subscribe(cb);
Diagnostics:
1. expected a `std::ops::Fn<(std::rc::Rc<utils::sprites::store::StateSprites>,)>` closure, found `yew::Callback<std::rc::Rc<utils::sprites::store::StateSprites>>`
the trait `std::ops::Fn<(std::rc::Rc<utils::sprites::store::StateSprites>,)>` is not implemented for `yew::Callback<std::rc::Rc<utils::sprites::store::StateSprites>>`
the trait `yewdux::subscriber::Callable<S>` is implemented for `yew::callback::Callback<std::rc::Rc<S>>`
required for `yew::Callback<std::rc::Rc<utils::sprites::store::StateSprites>>` to implement `yewdux::subscriber::Callable<utils::sprites::store::StateSprites>` [E0277]
2. required by a bound introduced by this call [E0277]
Any updates? I am too getting the same error.
in use_store let (store, dispatch):(Rc,Dispatch) = usestore::();
Error: the trait bound `impl yew::functional::hooks::Hook<Output = (Rc, yewdux::dispatch::Dispatch)> + ' : Hook
is not satisfied the trait
Hookis implemented for
BoxedHook<'_, T>`