mirror of
https://github.com/langgenius/dify.git
synced 2025-12-19 22:28:46 +00:00
fix: add missing key prop to TabPanel and initialize useRef with null (#26517)
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user