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.

fix: add missing key prop to TabPanel and initialize useRef with null (#26517)

lyzno1b80d55b76490
diff --git a/web/app/components/develop/code.tsx b/web/app/components/develop/code.tsx
index eadc87a5ca6..69d56249665 100644
--- a/web/app/components/develop/code.tsx
+++ b/web/app/components/develop/code.tsx
@@ -193,8 +193,8 @@ function CodeGroupPanels({ children, targetCode, ...props }: ICodeGroupPanelsPro
if ((targetCode?.length ?? 0) > 1) {
return (
<TabPanels>
- {targetCode!.map(code => (
- <TabPanel>
+ {targetCode!.map((code, index) => (
+ <TabPanel key={code.title || code.tag || index}>
<CodePanel {...props} targetCode={code} />
</TabPanel>
))}
@@ -206,8 +206,8 @@ function CodeGroupPanels({ children, targetCode, ...props }: ICodeGroupPanelsPro
}
function usePreventLayoutShift() {
- const positionRef = useRef<any>()
- const rafRef = useRef<any>()
+ const positionRef = useRef<any>(null)
+ const rafRef = useRef<any>(null)
useEffect(() => {
return () => {