From 2b601f0a2ad116f1301cc7b0704a84e316de05e3 Mon Sep 17 00:00:00 2001 From: Thibault Date: Thu, 15 May 2025 00:00:06 +0900 Subject: [PATCH] Update ssr.md This is required for Tanstack Start otherwise the following error appears ``` [vite] (ssr) Error when evaluating SSR module /src/routes/index.tsx?tsr-directive-use-server=: Cannot access 'formOpts' before initialization ``` --- docs/framework/react/guides/ssr.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/framework/react/guides/ssr.md b/docs/framework/react/guides/ssr.md index 6b18a8460..80ea4ec49 100644 --- a/docs/framework/react/guides/ssr.md +++ b/docs/framework/react/guides/ssr.md @@ -25,7 +25,7 @@ This section focuses on integrating TanStack Form with TanStack Start. Let's start by creating a `formOption` that we'll use to share the form's shape across the client and server. ```typescript -// app/routes/index.tsx, but can be extracted to any other path +// src/utils/form-isomorphic.ts, but can be extracted to any other path import { formOptions } from '@tanstack/react-form' // You can pass other form options here @@ -113,6 +113,7 @@ import { useStore, useTransform, } from '@tanstack/react-form' +import { formOpts } from '~/utils/form-isomorphic' export const Route = createFileRoute('/')({ component: Home,