useStateObject

@StateObject: creates the object once for the component's lifetime, and observes it.

Declaration

React
function useStateObject<T extends ObservableObject>(
  create: () => T
): Observed<T>

Parameters

  • create*() => T

See also

More in Hooks.