Skip to content

Update display value whenever the data prop changes.#4

Open
JSONRice wants to merge 2 commits intoNovsochetra:mainfrom
JSONRice:display-value-update
Open

Update display value whenever the data prop changes.#4
JSONRice wants to merge 2 commits intoNovsochetra:mainfrom
JSONRice:display-value-update

Conversation

@JSONRice
Copy link

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.

Signed-off-by: jasonwr <jsnrice@gmail.com>
@JSONRice
Copy link
Author

JSONRice commented Jun 16, 2023

@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.

@Novsochetra
Copy link
Owner

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

Thank you 😉😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants