From 5ceda11a0bc0d8cca020b10a70a0d33b3a2345ef Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Thu, 13 Nov 2025 13:36:46 -0500 Subject: [PATCH] fix: add 'use client' to routing-forms components to resolve React error 185 (#25107) Adds 'use client' directive to FormInputFields.tsx and widgets.tsx in the routing-forms package. These components use React hooks (useLocale, setState) but were missing the client directive, causing React error 185 (invalid hook call) in production builds due to Next.js App Router bundling differences. The error only occurred in production, not local dev, because production builds optimize and bundle packages differently. The widgets.tsx file uses the useLocale hook in the Button component, and FormInputFields.tsx passes state setters to child components. Fixes the reroute dialog error reported in production. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- packages/app-store/routing-forms/components/FormInputFields.tsx | 2 ++ .../components/react-awesome-query-builder/widgets.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/app-store/routing-forms/components/FormInputFields.tsx b/packages/app-store/routing-forms/components/FormInputFields.tsx index f1f2cb6b4b..117232151e 100644 --- a/packages/app-store/routing-forms/components/FormInputFields.tsx +++ b/packages/app-store/routing-forms/components/FormInputFields.tsx @@ -1,3 +1,5 @@ +"use client"; + import type { Dispatch, SetStateAction } from "react"; import type { App_RoutingForms_Form } from "@calcom/prisma/client"; diff --git a/packages/app-store/routing-forms/components/react-awesome-query-builder/widgets.tsx b/packages/app-store/routing-forms/components/react-awesome-query-builder/widgets.tsx index 7b83afa964..3ca2f2e961 100644 --- a/packages/app-store/routing-forms/components/react-awesome-query-builder/widgets.tsx +++ b/packages/app-store/routing-forms/components/react-awesome-query-builder/widgets.tsx @@ -1,3 +1,5 @@ +"use client"; + import dynamic from "next/dynamic"; import type { ChangeEvent } from "react"; import type {