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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user