[英]how can I show error messages from responses from the server in form of alert message in MERN project?
我想向我的用戶顯示錯誤響應或從服務器響應中獲得的某種消息作為警報消息。 現在,我只在控制台中打印消息
您可以使用 toastify 顯示從后端收到的錯誤消息。
npm i react-toastify
示例: toast(response.msg)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.