useView function

Module @runic-artifex/react in @runic-artifex/react 0.23.0

function useView<TClient extends ViewClient>(source: ViewSource<TClient>, options?: UseViewOptions<TClient>): ViewHandle<TClient>;

Connects a generated View reference for the lifetime of the component and renders its state through useSyncExternalStore. When the component unmounts or the reference changes, the client stays connected for keepAlive milliseconds (2000 by default), and the next useView of the same reference takes it over with its state: StrictMode's simulated unmount, Fast Refresh, <Activity> and A→B→A navigation neither show "Connecting…" nor open the route again. A component that mounts while a client of its reference is kept renders its state in the first render. A reference is identified by its connect function, so an inline { connect: connectWorkspace } does not reconnect. In development a connect function recreated on every render logs a warning.