Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reloads onCurrentIndexChange function when state changes #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zshenkman
Copy link

@zshenkman zshenkman commented Jun 1, 2023

Why
Currently, the onCurrentIndexChange function provided to LineChart.Provider can't always access up-to-date state contents. As a result, performing actions such as referencing the data point at the current index may not be possible if the data changes.

How
This fix adds the onCurrentIndexChange function as a dependency to the useAnimatedReaction hook where it's called. This will allow the latest contents of the state to be accessed whenever the function is called.

Additional Changes
This PR also updates the versions of packages in the example app.

@arancauchi
Copy link
Collaborator

Thanks for this PR @zshenkman.

Would it be possible to amend this PR so that the changes do not include upgrades to dependencies?

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.

None yet

2 participants