We had to do vile things to get it working
export default App() {
const connectionBuilderTanstack = useMemo(() => {
return DbConnection.builder()
.withUri(HOST)
.withDatabaseName(DB_NAME)
.withToken(token ?? undefined)
.onConnect(onConnect)
.onDisconnect(onDisconnect)
.onConnectError(onConnectError);
}, [token]);
const connectionBuilderReact = useMemo(() => {
return DbConnection.builder()
.withUri(HOST)
.withDatabaseName(DB_NAME)
.withToken(token ?? undefined)
.onConnect(onConnect)
.onDisconnect(onDisconnect)
.onConnectError(onConnectError);
}, [token]);
return (
<SpacetimeDBProviderTanstack connectionBuilder={connectionBuilderTanstack}>
<SpacetimeDBProviderReact connectionBuilder={connectionBuilderReact}>
<RouterProvider router={router} />
<Toaster />
</SpacetimeDBProviderReact>
</SpacetimeDBProviderTanstack>
);
}
Solution: either export a version useProcedure as part of spacetimedb/tanstack that is hooked up to the tanstack provider OR unify the spacetimedb/react and spacetimedb/tanstack providers
Related: Pull #4752 and Issue #4751
We had to do vile things to get it working
Solution: either export a version
useProcedureas part ofspacetimedb/tanstackthat is hooked up to the tanstack provider OR unify thespacetimedb/reactandspacetimedb/tanstackprovidersRelated: Pull #4752 and Issue #4751