API reference › @evolu/react-native › web › ReactBinding
Defined in: react/dist/src/local-first/createEvoluBinding.d.ts:3
Properties
EvoluContext
readonly EvoluContext: FC<{
children?: ReactNode;
value: Evolu<S>;
}>;
Defined in: react/dist/src/local-first/createEvoluBinding.d.ts:5
Provides Evolu to React descendants consumed via useEvolu.
useEvolu
readonly useEvolu: () => Evolu<S>;
Defined in: react/dist/src/local-first/createEvoluBinding.d.ts:10
Returns the current Evolu instance from EvoluContext.
useOwner
readonly useOwner: (owner:
| ReadonlyOwner
| Owner, transports?: readonly [OwnerWebSocketTransport, OwnerWebSocketTransport]) => UnuseOwner;
Defined in: react/dist/src/local-first/createEvoluBinding.d.ts:53
Calls Evolu.useOwner on the current Evolu instance.
useQueries
readonly useQueries: <Q, OQ>(queries: [...Q[]], options?: Partial<{
once: [...OQ[]];
promises: [...QueriesToQueryRowsPromises<Q>[], ...QueriesToQueryRowsPromises<OQ>[]];
}>) => [...QueriesToQueryRows<Q>[], ...QueriesToQueryRows<OQ>[]];
Defined in: react/dist/src/local-first/createEvoluBinding.d.ts:35
The same as useQuery, but for many queries.
The number of queries must remain stable across renders.
useQuery
readonly useQuery: <R>(query: Query<S, R>, options?: Partial<{
once: boolean;
promise: Promise<QueryRows<R>>;
}>) => QueryRows<R>;
Defined in: react/dist/src/local-first/createEvoluBinding.d.ts:24
Load and subscribe to the Query, and return an object with rows and row
properties that are automatically updated when data changes.
Note that useQuery uses React Suspense. It means every usage of
useQuery blocks rendering until loading is completed. To avoid loading
waterfall with more queries, use useQueries.
The promise option allows preloading queries before rendering, which can
be useful for complex queries that might take noticeable time even with
local data. However, this is rarely needed as local queries are typically
fast.
useQuerySubscription
readonly useQuerySubscription: <R>(query: Query<S, R>, options?: Partial<{
once: boolean;
}>) => QueryRows<R>;
Defined in: react/dist/src/local-first/createEvoluBinding.d.ts:45