@dxos/react-client
    Preparing search index...

    Variable useTypeConst

    useType: <T extends Type.AnyEntity = Type.AnyEntity>(
        db?: Database.Database,
        typeUri?: URI.URI,
    ) => T | undefined

    Subscribe to and retrieve a type by its URI from a space: a static schema's typename DXN, or a persisted (database) schema's echo: EID (what Type.getURI / getTypeURIFromQuery produce).

    Fans across the owning space db (persisted custom types) and the shared registry (static/runtime plugin types). Persisted types live only in the db, so a registry-only lookup misses them.

    DXN matching is version-agnostic: dxn:com.example/Foo matches dxn:com.example/Foo:0.1.0. This lets callers pass a bare typename DXN (no version) from e.g. a ReferenceAnnotation.

    Type declaration

      • <T extends Type.AnyEntity = Type.AnyEntity>(
            db?: Database.Database,
            typeUri?: URI.URI,
        ): T | undefined
      • Type Parameters

        • T extends Type.AnyEntity = Type.AnyEntity

        Parameters

        • Optionaldb: Database.Database
        • OptionaltypeUri: URI.URI

        Returns T | undefined