Skip to content

Commit 2767ce0

Browse files
authored
fix(Drawer): update refs in examples (#12152)
Update ref types to HTMLSpanElement and initialize with null to fix TS errors Signed-off-by: Mohamed Fall <[email protected]>
1 parent d11c186 commit 2767ce0

18 files changed

+18
-18
lines changed

packages/react-core/src/components/Drawer/examples/DrawerAdditionalSectionAboveContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313

1414
export const DrawerAdditionalSectionAboveContent: React.FunctionComponent = () => {
1515
const [isExpanded, setIsExpanded] = useState(false);
16-
const drawerRef = useRef<HTMLDivElement>(undefined);
16+
const drawerRef = useRef<HTMLSpanElement>(null);
1717

1818
const onExpand = () => {
1919
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerBasic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414

1515
export const DrawerBasic: React.FunctionComponent = () => {
1616
const [isExpanded, setIsExpanded] = useState(false);
17-
const drawerRef = useRef<HTMLDivElement>(undefined);
17+
const drawerRef = useRef<HTMLSpanElement>(null);
1818

1919
const onExpand = () => {
2020
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerBasicInline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export const DrawerBasicInline: React.FunctionComponent = () => {
1414
const [isExpanded, setIsExpanded] = useState(false);
15-
const drawerRef = useRef<HTMLDivElement>(undefined);
15+
const drawerRef = useRef<HTMLSpanElement>(null);
1616

1717
const onExpand = () => {
1818
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerBasicPill.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export const DrawerBasicPill: React.FunctionComponent = () => {
1414
const [isExpanded, setIsExpanded] = useState(false);
15-
const drawerRef = useRef<HTMLDivElement>(undefined);
15+
const drawerRef = useRef<HTMLSpanElement>(null);
1616

1717
const onExpand = () => {
1818
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerBreakpoint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export const DrawerBreakpoint: React.FunctionComponent = () => {
1414
const [isExpanded, setIsExpanded] = useState(false);
15-
const drawerRef = useRef<HTMLDivElement>(undefined);
15+
const drawerRef = useRef<HTMLSpanElement>(null);
1616

1717
const onExpand = () => {
1818
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerInlinePanelEnd.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export const DrawerInlinePanelEnd: React.FunctionComponent = () => {
1414
const [isExpanded, setIsExpanded] = useState(false);
15-
const drawerRef = useRef<HTMLDivElement>(undefined);
15+
const drawerRef = useRef<HTMLSpanElement>(null);
1616

1717
const onExpand = () => {
1818
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerInlinePanelStart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export const DrawerInlinePanelStart: React.FunctionComponent = () => {
1414
const [isExpanded, setIsExpanded] = useState(false);
15-
const drawerRef = useRef<HTMLDivElement>(undefined);
15+
const drawerRef = useRef<HTMLSpanElement>(null);
1616

1717
const onExpand = () => {
1818
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerModifiedContentPadding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export const DrawerModifiedContentPadding: React.FunctionComponent = () => {
1414
const [isExpanded, setIsExpanded] = useState(false);
15-
const drawerRef = useRef<HTMLDivElement>(undefined);
15+
const drawerRef = useRef<HTMLSpanElement>(null);
1616

1717
const onExpand = () => {
1818
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerModifiedPanelPadding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export const DrawerModifiedPanelPadding: React.FunctionComponent = () => {
1414
const [isExpanded, setIsExpanded] = useState(false);
15-
const drawerRef = useRef<HTMLDivElement>(undefined);
15+
const drawerRef = useRef<HTMLSpanElement>(null);
1616

1717
const onExpand = () => {
1818
drawerRef.current && drawerRef.current.focus();

packages/react-core/src/components/Drawer/examples/DrawerPanelBottom.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export const DrawerPanelBottom: React.FunctionComponent = () => {
1414
const [isExpanded, setIsExpanded] = useState(false);
15-
const drawerRef = useRef<HTMLDivElement>(undefined);
15+
const drawerRef = useRef<HTMLSpanElement>(null);
1616

1717
const onExpand = () => {
1818
drawerRef.current && drawerRef.current.focus();

0 commit comments

Comments
 (0)