fix: add missing key prop to TabPanel and initialize useRef with null (#26517)
This commit is contained in:
parent
dd71625f52
commit
b80d55b764
1 changed files with 4 additions and 4 deletions
|
|
@ -193,8 +193,8 @@ function CodeGroupPanels({ children, targetCode, ...props }: ICodeGroupPanelsPro
|
||||||
if ((targetCode?.length ?? 0) > 1) {
|
if ((targetCode?.length ?? 0) > 1) {
|
||||||
return (
|
return (
|
||||||
<TabPanels>
|
<TabPanels>
|
||||||
{targetCode!.map(code => (
|
{targetCode!.map((code, index) => (
|
||||||
<TabPanel>
|
<TabPanel key={code.title || code.tag || index}>
|
||||||
<CodePanel {...props} targetCode={code} />
|
<CodePanel {...props} targetCode={code} />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
))}
|
))}
|
||||||
|
|
@ -206,8 +206,8 @@ function CodeGroupPanels({ children, targetCode, ...props }: ICodeGroupPanelsPro
|
||||||
}
|
}
|
||||||
|
|
||||||
function usePreventLayoutShift() {
|
function usePreventLayoutShift() {
|
||||||
const positionRef = useRef<any>()
|
const positionRef = useRef<any>(null)
|
||||||
const rafRef = useRef<any>()
|
const rafRef = useRef<any>(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue