# @latticexyz/react

# Functions

# useComponentValue

useComponentValue<S>(component, entityIndex, defaultValue): ComponentValue<S>

# Type parameters

Name Type
S extends Schema

# Parameters

Name Type
component Component<S, Metadata, undefined>
entityIndex undefined | EntityIndex
defaultValue ComponentValue<S, undefined>

# Returns

ComponentValue<S>

# Defined in

react/src/useComponentValue.ts:14

useComponentValue<S>(component, entityIndex): ComponentValue<S> | undefined

# Type parameters

Name Type
S extends Schema

# Parameters

Name Type
component Component<S, Metadata, undefined>
entityIndex undefined | EntityIndex

# Returns

ComponentValue<S> | undefined

# Defined in

react/src/useComponentValue.ts:20


# useDeprecatedComputedValue

useDeprecatedComputedValue<T>(computedValue): T

Deprecated

See https://github.com/latticexyz/mud/issues/339

# Type parameters

Name
T

# Parameters

Name Type
computedValue IComputedValue<T>

# Returns

T

# Defined in

react/src/useDeprecatedComputedValue.ts:5


# useEntityQuery

useEntityQuery(...args): EntityIndex[]

# Parameters

Name Type
...args [fragments: QueryFragment<Schema>[], options?: Object]

# Returns

EntityIndex[]

# Defined in

react/src/useEntityQuery.ts:7


# useObservableValue

useObservableValue<T>(observable, defaultValue): T

# Type parameters

Name
T

# Parameters

Name Type
observable Observable<T>
defaultValue T

# Returns

T

# Defined in

react/src/useObservableValue.ts:4

useObservableValue<T>(observable): T | undefined

# Type parameters

Name
T

# Parameters

Name Type
observable Observable<T>

# Returns

T | undefined

# Defined in

react/src/useObservableValue.ts:6