pub fn use_slice_value<T>() -> Rc<T> where T: Slice + 'static,
A read-only hook to connect to the value of a Slice.
Slice
Returns Rc<T>.
Rc<T>
#[function_component(CounterComp)] fn counter_comp() -> Html { let ctr = use_slice_value::<Counter>(); html! { <div> <div>{"Current Counter: "}{ctr.0}</div> </div> } }