Skip to content

Commit 474dc94

Browse files
committed
updated usage of hooks
1 parent 8a6e73d commit 474dc94

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/react-charts/src/victory/components/ChartLine/examples/ChartLine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ propComponents: [
1111
hideDarkMode: true
1212
---
1313

14-
import { createRef } from 'react';
14+
import { useRef, useState } from 'react';
1515
import { Chart, ChartAxis, ChartGroup, ChartLine, ChartThemeColor, ChartLegendTooltip, ChartVoronoiContainer, createContainer } from '@patternfly/react-charts/victory';
1616
import { getResizeObserver } from '@patternfly/react-core';
1717
import { VictoryZoomContainer } from 'victory-zoom-container';

packages/react-charts/src/victory/components/ChartLine/examples/ChartLineMultiColor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Chart, ChartAxis, ChartGroup, ChartLine, ChartThemeColor } from '@patternfly/react-charts/victory';
22
import { getResizeObserver } from '@patternfly/react-core';
3+
import { useRef, useState } from 'react';
34
import { VictoryZoomContainer } from 'victory-zoom-container';
45

56
interface PetData {
@@ -10,8 +11,8 @@ interface PetData {
1011
}
1112

1213
export const ChartLineMultiColor: React.FunctionComponent = () => {
13-
const containerRef = React.useRef<HTMLDivElement>(null);
14-
const [width, setWidth] = React.useState(0);
14+
const containerRef = useRef<HTMLDivElement>(null);
15+
const [width, setWidth] = useState(0);
1516

1617
const handleResize = () => {
1718
if (containerRef.current && containerRef.current.clientWidth) {

0 commit comments

Comments
 (0)