Skip to content

Commit 5ceda11

Browse files
fix: add 'use client' to routing-forms components to resolve React error 185 (calcom#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>
1 parent 787828d commit 5ceda11

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

packages/app-store/routing-forms/components/FormInputFields.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import type { Dispatch, SetStateAction } from "react";
24

35
import type { App_RoutingForms_Form } from "@calcom/prisma/client";

packages/app-store/routing-forms/components/react-awesome-query-builder/widgets.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import dynamic from "next/dynamic";
24
import type { ChangeEvent } from "react";
35
import type {

0 commit comments

Comments
 (0)