Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor & perf: declare const object outside component `ConstantField` (#17495)

yusheng chenbf69b976398d
diff --git a/web/app/components/workflow/nodes/_base/components/variable/constant-field.tsx b/web/app/components/workflow/nodes/_base/components/variable/constant-field.tsx
index 45a1328c7b3..52d26755101 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/constant-field.tsx
+++ b/web/app/components/workflow/nodes/_base/components/variable/constant-field.tsx
@@ -15,8 +15,10 @@ type Props = {
onChange: (value: string | number, varKindType: VarKindType, varInfo?: Var) => void
}
+const DEFAULT_SCHEMA = {} as CredentialFormSchema
+
const ConstantField: FC<Props> = ({
- schema = {} as CredentialFormSchema,
+ schema = DEFAULT_SCHEMA,
readonly,
value,
onChange,