Skip to content

Commit ce18034

Browse files
committed
updated usage of hooks
1 parent 7a8a8cc commit ce18034

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

packages/react-charts/src/victory/components/ChartDonutUtilization/examples/ChartUtilInvertedStatic.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChartDonutThreshold, ChartDonutUtilization } from '@patternfly/react-charts/victory';
2+
import { useEffect, useState } from 'react';
23

34
interface UsageData {
45
x?: string;
@@ -7,9 +8,9 @@ interface UsageData {
78
}
89

910
export const ChartUtilInvertedStatic: React.FunctionComponent = () => {
10-
const [used, setUsed] = React.useState(100);
11+
const [used, setUsed] = useState(100);
1112

12-
React.useEffect(() => {
13+
useEffect(() => {
1314
const interval = setInterval(() => {
1415
setUsed((prevUsed) => {
1516
const val = (prevUsed - 10 + 100) % 100;

packages/react-charts/src/victory/components/ChartDonutUtilization/examples/ChartUtilSmallStaticRightLegend.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChartDonutThreshold, ChartDonutUtilization } from '@patternfly/react-charts/victory';
2+
import { useEffect, useState } from 'react';
23

34
interface UsageData {
45
x?: string;
@@ -7,9 +8,9 @@ interface UsageData {
78
}
89

910
export const ChartUtilSmallStaticRightLegend: React.FunctionComponent = () => {
10-
const [used, setUsed] = React.useState(0);
11+
const [used, setUsed] = useState(0);
1112

12-
React.useEffect(() => {
13+
useEffect(() => {
1314
const interval = setInterval(() => {
1415
setUsed((prevUsed) => {
1516
const val = (prevUsed + 10) % 100;

packages/react-charts/src/victory/components/ChartDonutUtilization/examples/ChartUtilStaticCustomLegend.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChartDonutThreshold, ChartDonutUtilization, ChartThemeColor } from '@patternfly/react-charts/victory';
2+
import { useEffect, useState } from 'react';
23

34
interface UsageData {
45
x?: string;
@@ -7,9 +8,9 @@ interface UsageData {
78
}
89

910
export const ChartUtilStaticCustomLegend: React.FunctionComponent = () => {
10-
const [used, setUsed] = React.useState(0);
11+
const [used, setUsed] = useState(0);
1112

12-
React.useEffect(() => {
13+
useEffect(() => {
1314
const interval = setInterval(() => {
1415
setUsed((prevUsed) => {
1516
const val = (prevUsed + 10) % 100;

packages/react-charts/src/victory/components/ChartDonutUtilization/examples/ChartUtilStaticRightLegend.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChartDonutThreshold, ChartDonutUtilization } from '@patternfly/react-charts/victory';
2+
import { useEffect, useState } from 'react';
23

34
interface UsageData {
45
x?: string;
@@ -7,9 +8,9 @@ interface UsageData {
78
}
89

910
export const ChartUtilStaticRightLegend: React.FunctionComponent = () => {
10-
const [used, setUsed] = React.useState(0);
11+
const [used, setUsed] = useState(0);
1112

12-
React.useEffect(() => {
13+
useEffect(() => {
1314
const interval = setInterval(() => {
1415
setUsed((prevUsed) => {
1516
const val = (prevUsed + 10) % 100;

0 commit comments

Comments
 (0)