App Remounts on Navigation with Tanstack Router + Convex Auth
_authed.tsx:
app.tsx:
CC: @ballingt we disscused that issue a bit, I think it's good to have seperate topic about that
import { createFileRoute, Navigate, Outlet } from '@tanstack/react-router';
import { Authenticated, Unauthenticated } from 'convex/react';
export const Route = createFileRoute('/_authed')({
component: AuthenticatedLayoutRoute,
});
function AuthenticatedLayoutRoute() {
return (
<>
<Unauthenticated>
<Navigate to="/signin" />;
</Unauthenticated>
<Authenticated>
<Outlet />
</Authenticated>
</>
);
}const convex = new ConvexReactClient(
import.meta.env.VITE_CONVEX_URL as string,
{
verbose: true,
}
);
// Initialize Tanstack Query client
const queryClient = new QueryClient();
// Create the router
const router = createRouter({
routeTree,
context: {
queryClient,
convexClient: convex,
},
defaultPreload: 'intent',
defaultPreloadStaleTime: 0,
});
// Register the router instance for type safety
declare module '@tanstack/react-router' {
interface Register {
router: typeof router;
}
}
function InnerApp() {
return <RouterProvider router={router} />;
}
export default function App() {
return (
<ClerkProvider publishableKey="pk_...">
<ConvexProviderWithClerk client={convex} useAuth={useAuth}>
<InnerApp />
</ConvexProviderWithClerk>
</ClerkProvider>
);
}Why ctx.db is changing, and what you sho...
Nicolas · 2mo ago
## 🔐 Secure Webhook Log Streams Log stream requests sent to a webhook now include a cryptographic signature that you can check to make sure that the request comes from your Convex deployment. [Read the docs.](https://docs.convex.dev/production/integrations/log-streams/#securing-webhook-log-streams) ## 👁️ Hide Columns in the Dashboard There is a new menu in the dashboard *Data* page to reorder and hide columns. This is useful for projects that have a table with a lot of columns. [Check it out in the dashboard.](http://dashboard.convex.dev/deployment/data) ## ✨ Convex ESLint plugin The Convex ESLint rules are now out of beta. They enforce best practices for writing Convex code. We recommend setting them up in your projects. [Check out the docs.](https://docs.convex.dev/eslint) ## 💎 Zod 4 Support in convex-helpers The [Zod helpers in convex-helpers](https://github.com/get-convex/convex-helpers/blob/main/packages/convex-helpers/README.md#zod-validation) now support Zod 4. Zod 4’s Codecs feature makes it easy to serialize/deserialize function arguments and return values, as well as database values. [Learn more about Zod 4 support.](https://github.com/get-convex/convex-helpers/pull/840) **[Click here to get a shareable version of this post.](https://news.convex.dev/product-updates-volume-25/)**
Nicolas · 2mo ago
We have cool product updates to share! @everyone ## 👀 Preview Deployments for Everyone You no longer need to sign up for Convex Professional to use preview deployments: you can now use them with a free Convex account. [Read the docs.](https://docs.convex.dev/production/hosting/preview-deployments) ## 🤖 “Copy as Markdown” in Convex Docs It is now easier to add a page of the Convex documentation to your favorite LLM’s context: docs pages now have a “Copy as Markdown” button that copies a Markdown-formatted version of the page to your clipboard. [Go to Convex Docs.](https://docs.convex.dev/home) ## 🛡️ Additional Protection in `npx convex deploy` In the 1.30.0 version of the Convex CLI tool, the CLI will now ask for explicit confirmation before deleting large indexes (100,000+ documents). This helps avoid situations where an index is accidentally deleted and backfilling it takes a long time. [Read the changelog.](https://github.com/get-convex/convex-js/blob/main/CHANGELOG.md#1292) ## 📂 Exclude Files from Backups When using the Backups feature of Convex, you can now exclude file storage from backups. This can be useful when backing up very large projects. [Read the docs.](https://docs.convex.dev/database/backup-restore)
Nicolas · 2mo ago