0

i want to change value of textInput but it change all value of textinput , i know because of the state, but what the right way to handle this textInput or what i use is numericInput from react-native-numeric-input, thanks for helping.

<ScrollView>
  {this.state.display.map((info)=>{
    return 
    <View style={{paddingBottom:5,alignSelf:'center'}} key={info.id}>
      <View style={{ ... }}>
        <View style={{flexDirection:'row'}}>
          ...
          <View style={{justifyContent:'center',marginLeft:'auto',marginRight:10}}>
            <NumericInput 
              totalWidth={70} 
              totalHeight={30} 
              iconSize={10}
              initValue={this.state.v6}
              value={this.state.v6}
              onChange={(v6) => this.setState({ v6 })} 
              rounded 
              textColor='#59656F' 
              iconStyle={{ color: 'white' }} 
              rightButtonBackgroundColor='#AC9FBB' 
              leftButtonBackgroundColor='#DDBDD5' 
            />
          </View>
        </View>
      </View>
    </View> 
  })}
</ScrollView>

and this my state code

state={
  v6:0
}
kivul
  • 1,148
  • 13
  • 28
ghassan
  • 45
  • 2
  • 7

1 Answers1

0

Try changing the onChange to this:

onChange={(value) => this.setState({ v6: value })} 
kivul
  • 1,148
  • 13
  • 28