Skip to content

Commit 222caac

Browse files
fix(HeaderPanel): properly type forwardRef to support ref prop (#20327)
* fix(HeaderPanel): properly type forwardRef to support ref prop * refactor(HeaderPanel): remove explicit typing of Forwarded ref
1 parent 045abe3 commit 222caac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/react/src/components/UIShell/HeaderPanel.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import React, {
1212
useRef,
1313
useState,
1414
type ComponentProps,
15-
type ForwardedRef,
1615
type ReactNode,
1716
} from 'react';
1817
import { usePrefix } from '../../internal/usePrefix';
@@ -55,7 +54,7 @@ export interface HeaderPanelProps {
5554
onHeaderPanelFocus?: () => void;
5655
}
5756

58-
const HeaderPanel: React.FC<HeaderPanelProps> = React.forwardRef(
57+
const HeaderPanel = React.forwardRef<HTMLDivElement, HeaderPanelProps>(
5958
(
6059
{
6160
children,
@@ -66,7 +65,7 @@ const HeaderPanel: React.FC<HeaderPanelProps> = React.forwardRef(
6665
href,
6766
...rest
6867
},
69-
ref: ForwardedRef<HTMLDivElement>
68+
ref
7069
) => {
7170
const prefix = usePrefix();
7271
const headerPanelReference = useRef<HTMLDivElement>(null);

0 commit comments

Comments
 (0)