React native 如何修改onLeftButtonPress中的状态?
如何修改onLeftButtonPress中的状态?因为我需要单击来制作动画,所以显示或隐藏我存储在状态中React native 如何修改onLeftButtonPress中的状态?,react-native,React Native,如何修改onLeftButtonPress中的状态?因为我需要单击来制作动画,所以显示或隐藏我存储在状态中 _getRoute(component) { var com = new component(); return { component: component, title: com.getNavTitle(), passProps: { myProp: 'foo' }, leftButtonIcon: com.getNavLeft().icon,
_getRoute(component) {
var com = new component();
return {
component: component,
title: com.getNavTitle(),
passProps: { myProp: 'foo' },
leftButtonIcon: com.getNavLeft().icon,
onLeftButtonPress: com.getNavLeft().onPress,
interactivePopGestureEnabled: true
};
}
getNavLeft(){
}
return {
icon: require('../Images/wo_de.png'),
onPress: () => {
console.log(this);
this.setState({leftShow: true});
Animated.timing( // Uses easing functions
this.state.leftWidthAnim, // The value to drive
{toValue: 0} // Configuration
).start();
}
};