pub fn use_ref_with<T>(
    hooks: &mut Hooks<'_>,
    init: impl FnOnce(&mut World) -> T
) -> Arc<Mutex<RawMutex, T>>
where T: Send + Debug + 'static,
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.