标签: react-notifications

如何在react-native项目中检查google play services版本和firebase版本?

我正在尝试安装 rn-push-notifications,我需要 google play services 版本和 firebase 版本。你能帮我一下吗?

javascript react-native react-native-push-notification react-notifications

5
推荐指数
2
解决办法
7671
查看次数

当页面重定向到另一个页面时,React toastify 不起作用。但它正在同一页面上工作

我使用react-toastify进行toast通知,但是当我的页面重定向到另一个页面时它不起作用。

mydata 无法保存到数据库。当我的页面没有重定向时它正在工作。

const [email, setEmail] = useState("");
const [password, setPassword] = useState("");

const loginUser = async (e) => {
    e.preventDefault();
    const res = await fetch("/signin", {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
        },
        body: JSON.stringify({ email, password }),

    });

    const data = await res.json();
    if (res.status === 422 || !res) {
        warningAlert();
        console.log(res);
        console.log("Invalid Credentials")
    } else {
        successAlert();
        dispatch({ type: "USER", payload: true });
        // console.log(res);
        history.push("/");

    }
}
Run Code Online (Sandbox Code Playgroud)

以上代码用于登录。这里的通知不是在else条件下工作,而是在条件下工作if

上述警报

    const successAlert = …
Run Code Online (Sandbox Code Playgroud)

reactjs react-notifications

4
推荐指数
2
解决办法
9322
查看次数