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>
This commit is contained in:
Joe Au-Yeung
2025-11-13 18:36:46 +00:00
committed by GitHub
co-authored by Devin AI
parent 787828d0ca
commit 5ceda11a0b
2 changed files with 4 additions and 0 deletions
@@ -1,3 +1,5 @@
"use client";
import type { Dispatch, SetStateAction } from "react";
import type { App_RoutingForms_Form } from "@calcom/prisma/client";
@@ -1,3 +1,5 @@
"use client";
import dynamic from "next/dynamic";
import type { ChangeEvent } from "react";
import type {