当我存储我的值时,React-Native textInput和firebase连接问题

时间:2018-03-12 16:12:39

标签: javascript ios firebase react-native input

我有2个TextInput,我想将值存储在我的状态:

                <CustomInput
                  underlineColorAndroid="#58CAF1"
                  style={styles.inputScheduleTime}
                  // ref="lundiStart"
                  placeholder="18H00..."
                  keyboardType="numeric"
                  onChangeText={ input2 => {
                    this.setState({ monday: {
                      start: this.state.monday.start,
                      end:this.state.monday.end + ':' + input2 }
                    });
                    console.log(this.state.monday)
                  }
                }
                />

当我存储输入值时,他存储了值但是在......之间加了0: enter image description here

这是我输入的屏幕截图:

enter image description here

我首先输入9然后输入00然后输入10,最后输入00
我有这样的控制台日志,input4是第四个和最后一个输入:

         <CustomInput
          underlineColorAndroid="#58CAF1"
          style={styles.inputScheduleTime}
          // ref="lundiStart"
          placeholder="18H00..."
          keyboardType="numeric"
          onChangeText={ input4 => {
            console.log("input4 : " + input4);
            this.setState({ monday: {
              start: this.state.monday.start,
              end:this.state.monday.end + ':' + input4 }
            });
            console.log("start : " + this.state.monday.start);
            console.log("end : " + this.state.monday.end);
          }
        }
        />

和我的控制台日志:

enter image description here

我不明白为什么? 也许是我设定国家的方式?

0 个答案:

没有答案