skip to Main Content

Reactjs – React async doesn't trigger rerender

const AUTH_DISABLED = 0; const AUTH_LOGIN = 1; const AUTH_LOGOUT = 2; function App() { const [showLoginPopup, setShowLoginPopup] = useState(false); const [authButtonState, setAuthButtonState] = useState(AUTH_DISABLED); const handleClick = () => { if ( authButtonState == AUTH_LOGOUT ) { authGlobal.logout().then( ()…

VIEW QUESTION

Reactjs – When i used the useState in react Js for password show and hide on icon click there are not working?

import React,{useState} from "react"; function Password(){ const [pass,setPass] = useState("password") const handleclick =()=>{ setPass(("password")? "text" : "password") } return( <div> Password:<span style={{position:"relative"}}><input type={pass} name="" id="" /> <i onClick={handleclick} style={{position:"absolute", top:"6px" , right:"5px"}} class="fa-solid fa-eye"></i></span> </div> ) } export default Password;…

VIEW QUESTION
Back To Top
Search