Skip to content

Commit cab491b

Browse files
committed
update to react 19 syntax
1 parent e5c5425 commit cab491b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/react-core/src/components/DataList/DataListCell.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FunctionComponent, useRef, useState, useEffect } from 'react';
12
import { css } from '@patternfly/react-styles';
23
import styles from '@patternfly/react-styles/css/components/DataList/data-list';
34
import { DataListWrapModifier } from './DataList';
@@ -20,7 +21,7 @@ export interface DataListCellProps extends Omit<React.HTMLProps<HTMLDivElement>,
2021
wrapModifier?: DataListWrapModifier | 'nowrap' | 'truncate' | 'breakWord';
2122
}
2223

23-
export const DataListCell: React.FunctionComponent<DataListCellProps> = ({
24+
export const DataListCell: FunctionComponent<DataListCellProps> = ({
2425
children = null,
2526
className = '',
2627
width = 1,
@@ -30,10 +31,10 @@ export const DataListCell: React.FunctionComponent<DataListCellProps> = ({
3031
wrapModifier = null,
3132
...props
3233
}: DataListCellProps) => {
33-
const cellRef = React.useRef(null);
34-
const [isTooltipVisible, setIsTooltipVisible] = React.useState(false);
34+
const cellRef = useRef(null);
35+
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
3536

36-
React.useEffect(() => {
37+
useEffect(() => {
3738
if (!cellRef.current || wrapModifier !== 'truncate') {
3839
return;
3940
}

0 commit comments

Comments
 (0)