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

support onAnimationEnd #198

Merged
merged 2 commits into from
May 27, 2018
Merged

Conversation

EyMaddis
Copy link
Contributor

This PR allows to correctly track if the toggle animation has ended.
It is relevant when trying to apply heavy layouts after the animation is done, avoiding stutter since the height animation is not possible through useNativeDriver.

The start of an animation is easily trackable, because the parent component triggers the collapse, so there is no need for onAnimationStart.

The same was implemented for the Accordion, but since it can trigger multiple collapses, it will trigger the callback for each one. In order to keep track of this, the callback receives the current section and index as parameters.

Copy link
Collaborator

@iRoachie iRoachie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good use case. My only change is that I’d like for you to add defaultProps for both of them, since this will error if they don’t pass in this prop.

@EyMaddis
Copy link
Contributor Author

@iRoachie done

@iRoachie iRoachie changed the base branch from master to next May 27, 2018 04:07
@iRoachie iRoachie merged commit 3a600ca into oblador:next May 27, 2018
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