-
-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
* support onAnimationEnd * add to defaultProps
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ export default class Collapsible extends Component { | |
duration: PropTypes.number, | ||
easing: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | ||
style: ViewPropTypes.style, | ||
onAnimationEnd: PropTypes.func, | ||
children: PropTypes.node, | ||
}; | ||
|
||
|
@@ -22,6 +23,7 @@ export default class Collapsible extends Component { | |
collapsedHeight: 0, | ||
duration: 300, | ||
easing: 'easeOutCubic', | ||
onAnimationEnd: () => {}, | ||
}; | ||
|
||
constructor(props) { | ||
|
@@ -142,7 +144,7 @@ export default class Collapsible extends Component { | |
toValue: height, | ||
duration, | ||
easing, | ||
}).start(() => this.setState({ animating: false })); | ||
}).start(() => this.setState({ animating: false }, this.props.onAnimationEnd)); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
iRoachie
Collaborator
|
||
} | ||
|
||
_handleLayoutChange = event => { | ||
|
hey, just wondering but isn't there a chance this callback gets fired even after component unmounts?