反应本地,博览会。好像中频功能不起作用

时间:2020-03-27 19:28:49

标签: javascript firebase react-native

在检查基本逻辑内容之前,我具有创建用户的功能:如果两个密码都输入,是否匹配,所有值都不为空字符串:

handleSignUp = () => {

    if (this.state.name == "") this.setState({ errorMessage: "Please enter name" });
        else  if (this.state.email == "") this.setState({ errorMessage: "Please enter email" });
            else if (this.state.password == "") this.setState({ errorMessage: "Please enter password" });
                else  if (this.state.password2 == "") this.setState({ errorMessage: "Please repeat password" });
                    else if ( this.state.password != this.state.password2) this.setState({ errorMessage: "Passwords doesn't match" });
                        else { 
                            Fire.shared.createUser(this.state.user);
                        };
};

但是我只能使用第一个密码创建用户,第二个绝对为空...
我在这里想念什么?

0 个答案:

没有答案