【问题标题】:Redirect to another page React-Native重定向到另一个页面 React-Native
【发布时间】:2019-07-01 07:40:33
【问题描述】:

为什么它不重定向到另一个页面??

findUtente(cf) {
    let params = {};
    console.log(cf)
    params = {
      "Person.FiscalCode": cf
    };
    global.utente.db
      .localdb()
      .find({
        selector: params
      })
      .then(response => {
        let utente = response.docs[0];
          console.log("You are here 1")
          utente.Person.FirstName = this.state.FirstName;
          utente.Person.LastName = this.state.LastName;
          //return global.utente.db.localdb().put(utente);
          global.utente.db.localdb().put(utente);
          console.log(global.utente.db.localdb().put(utente))
          console.log("You are here 2")
          Alert.alert("Modifica Effettuata")
          Actions.HomepageUtente();
      })
      .catch(function(err) {
        console.log(JSON.stringify(err));
      })

控制台日志只打印“You are here 1”。

这是调用这个函数的按钮

<View style={style.footer}>
              <TouchableOpacity
                style={[style.button, style.buttonOK]}
                onPress={() => this.findUtente(this.props.cf)}
              >
                <Text style={style.buttonTesto}>Modifica</Text>
              </TouchableOpacity>
            </View>

我该怎么办?谢谢

【问题讨论】:

  • 删除console.log(global.utente.db.localdb().put(utente))
  • @khan 是的,我使用 Couch/Pouch
  • @hongdevelop 没有改变 :(

标签: javascript react-native


【解决方案1】:

我已经解决了:

.finally(function() { Actions.linktopage ) });

【讨论】:

    猜你喜欢
    • 2021-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多