Tuesday, 22 March 2022

React SweetAlert with time out

 "sweetalert2": "^11.4.6", "sweetalert2-react-content": "^4.2.0"


add in package.json dependencies.

for login failed

if(data.response == "Invalid Login Credentials"){
                Swal.fire({
                    title:'Error!',
                    text:  "Invalid Login Credentials",
                    icon: 'error',
                    confirmButtonText: 'OK'
                })
            }
for login success
  if(data.response != "Invalid Login Credentials"){
                Swal.fire({
                    title: "Success!",
                    text: "Login Done Successfully!!",
                    type: "success",
                    timer: 1000
                })
            }
https://react-hook-form.com/advanced-usage


https://react-hook-form.com/api/useform/reset/
https://blog.logrocket.com/react-hooks-cheat-sheet-unlock-solutions-to-common-problems-af4caf699e70/

No comments:

Post a Comment

Car pooling app

 I'll create a car pooling app with real-time vehicle tracking, pickup/drop time estimates, and a list of onboard users. Since we don...