AlertIOSウィンドウでユーザーが「はい」をクリックすると、定数を更新しようとしています。アクションがtrueの場合、OnPressから状態を更新します。
しかし、それが現在、
deleteDeck =() => {
const {id} = this.props
const executeRemoval = false
if (Platform.OS === 'ios') {
AlertIOS.alert(
'Remove Deck',
'Are you sure you want to delete this deck?',
[
{text: 'Cancel', onPress:() => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'Yes', onPress:() => executeRemoval = true},
],
)
}
として構築作業得ることができないとユーザーを押した場合にはいconstのexecuteRemovalは今、真である必要があり、その入力
{executeRemoval &&
removeDeck(id)
.then(() => this.props.deleteDeck(id))
.then(() => this.props.navigation.dispatch(NavigationActions.reset({
index: 0,
actions: [
NavigationActions.navigate({ routeName: 'Home'})
]
})))
}
誰でも上の任意の考えを持っていますこの行動師を働かせるには?