intendednull / yewdux

Ergonomic state management for Yew applications
https://intendednull.github.io/yewdux/
Apache License 2.0
322 stars 31 forks source link

yewdux-functional won't compile #19

Closed pbspbsingh closed 2 years ago

pbspbsingh commented 2 years ago
Compiling yewdux-functional v0.1.0 (https://github.com/intendednull/yewdux#8bbb5f9c)
error[E0308]: mismatched types
  --> /Users/pbsingh/DevTools/Rust/cargo/git/checkouts/yewdux-cc25a1d21ecd63a8/8bbb5f9/yewdux-functional/src/lib.rs:25:28
   |
25 |           self.output = Some(use_ref(move || {
   |  ____________________________^
26 | |             Dispatch::bridge(Default::default(), on_output.into())
27 | |         }));
   | |__________^ expected struct `RefCell`, found struct `Dispatch`
   |
   = note: expected struct `std::rc::Rc<RefCell<Dispatch<T, T>>>`
              found struct `std::rc::Rc<Dispatch<_, _>>`

error[E0308]: mismatched types
  --> /Users/pbsingh/DevTools/Rust/cargo/git/checkouts/yewdux-cc25a1d21ecd63a8/8bbb5f9/yewdux-functional/src/lib.rs:78:9
   |
78 |         dispatch,
   |         ^^^^^^^^ expected struct `RefCell`, found struct `Dispatch`
   |
   = note: expected struct `std::rc::Rc<RefCell<Dispatch<_>>>`
              found struct `std::rc::Rc<Dispatch<_>>`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `yewdux-functional` due to 2 previous errors
mc1098 commented 2 years ago

This is due to this PR landing in Yew that refactors the use_ref to be an immutable ref and so for migration, yewdux will want to change the use_ref to use_mut_ref.