• When the component is first mounted, this hook creates and returns a a new long-lived @watchable/store!Store initialised with initialState.

    In later renders the hook will always return the same Store, It deliberately doesn't force a component refresh when the Store state changes. Any changes to initialState after the first render are therefore ignored. To track changes in the store, see useSelected or useRootState.

    Type Parameters

    • T extends unknown

    Parameters

    • initialState: T

    Returns Store<T>

    A lazily-created @watchable/store!Store