我在基于类的组件中获得输出,但我想知道如何在功能组件中完成同样的事情
class Apps extends React.Component {
handleViewRef = ref => this.view = ref;
bounce = () => this.view.bounce(800)
render() {
return (
<View style={{margin:60}}>
<TouchableWithoutFeedback onPress={this.bounce}>
<Animatable.View ref={this.handleViewRef}>
<Text>Bounce me!</Text>
</Animatable.View>
</TouchableWithoutFeedback>
</View>
);
}
}