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

Provides internally mutable state that is preserved between re-renders.

This should be used over use_state when reference semantics are required for the state as opposed to value semantics.

Note: Locking the mutex and modifying the value won’t cause a re-render. To re-render the element, use use_rerender_signal.