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 `VarReferencePicker` (#17496)

yusheng chene3dc9f3c3198
diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
index 3597c6493cc..a9b51d5a1e2 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
+++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
@@ -68,12 +68,14 @@ type Props = {
zIndex?: number
}
+const DEFAULT_VALUE_SELECTOR: Props['value'] = []
+
const VarReferencePicker: FC<Props> = ({
nodeId,
readonly,
className,
isShowNodeName = true,
- value = [],
+ value = DEFAULT_VALUE_SELECTOR,
onOpen = noop,
onChange,
isSupportConstantValue,