pub fn use_state_with<T>(
    hooks: &mut Hooks<'_>,
    init: impl FnOnce(&mut World) -> T
) -> (T, Arc<CbDebuggable<dyn Fn(T) + Sync + Send>>)
where T: Clone + Debug + Send + 'static,
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.