react-native-circular-chart icon indicating copy to clipboard operation
react-native-circular-chart copied to clipboard

Update display value whenever the data prop changes.

Open JSONRice opened this issue 2 years ago • 2 comments

As the title suggests this pull request addresses the data updates changing the display value since the displayValue is set to an initial value of data[0]

This line:

const [displayValue, setDisplayValue] = useState<DonutItem>(data[0]);

Only get initialized once and never updates so a useEffect is a workaround.

JSONRice avatar Jun 16 '23 05:06 JSONRice

@Novsochetra please oh please oh please oh please review and merge. Thank you. 🙏 I really want to use your software but really need this bug resolved. Thank you.

JSONRice avatar Jun 16 '23 05:06 JSONRice

@jasonwr thank for pointing out this section. I will check this PR and merged for the next release.

Thank you 😉😉

Novsochetra avatar Jun 20 '23 00:06 Novsochetra