0
メソッドを呼び出してパラメータを渡すときにエラーが発生し、ボタンの背後にあるアクションが自動的に実行されます。ここでReact Native:処理されていない約束の拒否、無効な引数の提供
は私のレンダリングです:
render() {
return (<View style={styles.container}>
<Card>
<CardSection>
<Button
accessibilityLabel='Click this button to find somewhere you and your friend can meet'
onPress={this.handleGetDirections(this.state.lat1, this.state.lng1, this.state.lat2, this.state.lng2)}
>
Get Directions
</Button>
</CardSection>
</Card>
</View>);
}
ここに私のエラーメッセージのビットは次のとおりです。
私はパラメータとして関数に状態を渡すことになっていないだろうか? docsから
'返しhandleGetDirections'んでしょうか? –