Announcing Yew 0.21
The Yew development team is thrilled to unveil Yew 0.21.0, a significant milestone in the journey of empowering developers to create dependable and high-performance web applications with Rust. Let's dive into the major highlights of this release.
What's new
1. Changing Signatures: A Shift in Hook Dependencies
One of the significant changes in Yew 0.21 is the adjustment to the signature of hooks that accept dependencies. Dependencies used to be passed as the second argument after the closure. However, now they're passed as the first argument before the closure.
use_effect_with_deps(deps, move |deps: Vec<i32>| {
// Do something with dependencies
});
The reason behind swapping the order of dependencies in the code snippet is to address a specific use case. In situations where the same value is needed both to compute a dependency and to be moved by value into the closure, the new order simplifies the code and improves readability and ergonomics.
This is a big breaking change so we've provided a way to automate the refactor