pub fn use_state_with<T: Clone + Debug + Send + 'static>(
    hooks: &mut Hooks<'_>,
    init: impl FnOnce(&mut World) -> T
) -> (T, Setter<T>)
Expand description

The same as use_state, but with a function that returns the initial value.

This can be used to avoid cloning the initial value each time the Element is re-rendered.