Skip to content
This repository was archived by the owner on Sep 13, 2020. It is now read-only.

Commit e1cef09

Browse files
author
Kureev Alexey
committed
Support animationStyle function
1 parent edd3740 commit e1cef09

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,7 @@ class SideMenu extends Component {
228228

229229
return (
230230
<Animated.View
231-
style={[styles.frontView, {
232-
transform: [{
233-
translateX: this.state.left,
234-
}],
235-
}, ]}
231+
style={[styles.frontView, this.props.animationStyle(this.state.left)]}
236232
ref={(sideMenu) => this.sideMenu = sideMenu}
237233
{...this.responder.panHandlers}>
238234
{children}
@@ -298,6 +294,13 @@ SideMenu.defaultProps = {
298294
toleranceX: 10,
299295
touchToClose: false,
300296
onChange: () => {},
297+
animationStyle: function(prop) {
298+
return {
299+
transform: [{
300+
translateX: prop,
301+
}],
302+
};
303+
},
301304
animationFunction: (prop, value) => {
302305
return Animated.spring(
303306
prop,

0 commit comments

Comments
 (0)