File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1- import React , { useContext , useState } from "react" ;
1+ import React , { useContext , useEffect , useState } from "react" ;
22import styled , { ThemeProvider } from "styled-components" ;
33import { spaces } from "../common/variables.js" ;
44import useTheme from "../useTheme" ;
@@ -15,10 +15,13 @@ const DxcProgressBar = ({
1515} : Props ) : JSX . Element => {
1616 const colorsTheme = useTheme ( ) ;
1717 const backgroundType = useContext ( BackgroundColorContext ) ;
18+ const [ valueProgressBar , setValueProgressBar ] = useState ( 0 ) ;
1819
19- const [ valueProgressBar ] = useState (
20- value === null || value === undefined || value < 0 ? 0 : value >= 0 && value <= 100 ? value : 100
21- ) ;
20+ useEffect ( ( ) => {
21+ setValueProgressBar (
22+ value === null || value === undefined || value < 0 ? 0 : value >= 0 && value <= 100 ? value : 100
23+ ) ;
24+ } , [ value ] ) ;
2225
2326 return (
2427 < ThemeProvider theme = { colorsTheme . progressBar } >
You can’t perform that action at this time.
0 commit comments