<Icon.Button onPress={() => {this._change('male')}} name="ios-male">男</Icon.Button>這樣寫會報錯,需要以下寫法,放到return里面去<Icon.Button onPress={() => {() => {this._change('male')} }} name="ios-male">男</Icon.Button>有大神知道為什么嗎
react-native 里面onPress函數(shù)不能直接寫帶參數(shù)的函數(shù)
米脂
2018-11-15 18:19:39