From 5175b42870c0d39adced1b93c4d36858f8c59ef5 Mon Sep 17 00:00:00 2001 From: melloware Date: Tue, 9 Apr 2024 12:52:44 -0400 Subject: [PATCH] Fix #6340: MeterGroup minor refactor similar to other components --- components/lib/metergroup/MeterGroup.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/lib/metergroup/MeterGroup.js b/components/lib/metergroup/MeterGroup.js index 47007709e2..e79b54224f 100644 --- a/components/lib/metergroup/MeterGroup.js +++ b/components/lib/metergroup/MeterGroup.js @@ -1,12 +1,12 @@ -import { useContext } from 'react'; -import { useMergeProps } from '../hooks/Hooks'; +import * as React from 'react'; import { PrimeReactContext } from '../api/Api'; -import { DomHandler, ObjectUtils, classNames } from '../utils/Utils'; -import { MeterGroupBase } from './MeterGroupBase'; import { useHandleStyle } from '../componentbase/ComponentBase'; +import { useMergeProps } from '../hooks/Hooks'; +import { ObjectUtils, classNames } from '../utils/Utils'; +import { MeterGroupBase } from './MeterGroupBase'; export const MeterGroup = (inProps) => { - const context = useContext(PrimeReactContext); + const context = React.useContext(PrimeReactContext); const props = MeterGroupBase.getProps(inProps, context); const { values, min, max, orientation, labelPosition, start, end, meter, labelList } = props; @@ -146,7 +146,8 @@ export const MeterGroup = (inProps) => { values }; - const labelElement = ObjectUtils.getJSXElement(labelList || createLabelList, { values, totalPercent }); + const labelListContent = labelList || createLabelList(); + const labelElement = ObjectUtils.getJSXElement(labelListContent, { values, totalPercent }); return (