請幫助我我有一個TextInput,我的問題是當我鍵入數值時,該值將與一些數字相乘。當我輸入1000這將存儲在1000狀態,但它存儲爲100。結果將不同。TextInput OnChange in React native
<TextInput
onChangeText={this.handle_bill_Amount}
style={styles.input}
placeholder="Amount"
value={this.state.Amount}
keyboardType = 'numeric'
enablesReturnKeyAutomatically={true}
placeholderTextColor = "#824242"
underlineColorAndroid="transparent">
</TextInput>
handle_bill_Amount = Amount => {
this.setState({ Amount})
let billamt = this.state.Amount;
console.log(billamt);
}
constructor(props) {
super(props);
this.state = {
Amount: '',
}
this.handle_bill_Amount = this.handle_bill_Amount.bind(this);
}
請大家幫幫我!
看看https://snack.expo.io/rJlNjP94-。如果您有更多疑慮,請通知我 –