Skip to content

Commit a9d6fbd

Browse files
fix: resolve blank form in analytics app installation step 3 (#23924)
- Add mounted state to ensure component renders after hydration - Fix hydration mismatch between server and client rendering - Ensure ConfigureStepCard renders properly on initial load in production Fixes the issue where GTM analytics app configuration form appears blank on step 3 until page refresh. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 3e1629a commit a9d6fbd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

apps/web/components/apps/installation/ConfigureStepCard.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { useFieldArray, useFormContext } from "react-hook-form";
77
import { useForm } from "react-hook-form";
88
import { z } from "zod";
99

10+
import type { LocationObject } from "@calcom/app-store/locations";
1011
import NoSSR from "@calcom/lib/components/NoSSR";
1112
import { locationsResolver } from "@calcom/lib/event-types/utils/locationsResolver";
1213
import { useLocale } from "@calcom/lib/hooks/useLocale";
13-
import type { LocationObject } from "@calcom/app-store/locations";
1414
import type { AppCategories } from "@calcom/prisma/enums";
1515
import type { EventTypeMetaDataSchema, eventTypeBookingFields } from "@calcom/prisma/zod-utils";
1616
import { Avatar } from "@calcom/ui/components/avatar";
@@ -213,6 +213,7 @@ const ConfigureStepCardContent: FC<ConfigureStepCardProps> = (props) => {
213213
);
214214

215215
const [submit, setSubmit] = useState(false);
216+
const [mounted, setMounted] = useState(false);
216217
const allUpdated = updatedEventTypesStatus.every((item) => item.every((iitem) => iitem.updated));
217218

218219
useEffect(() => {
@@ -222,7 +223,11 @@ const ConfigureStepCardContent: FC<ConfigureStepCardProps> = (props) => {
222223
}
223224
}, [submit, allUpdated, mainForSubmitRef]);
224225

225-
if (!formPortalRef?.current) {
226+
useEffect(() => {
227+
setMounted(true);
228+
}, []);
229+
230+
if (!formPortalRef?.current || !mounted) {
226231
return null;
227232
}
228233

0 commit comments

Comments
 (0)