useState is not updating in reactjs, although backend is proper
This is my react code for Protected Route: import React, { useState } from "react"; import { Navigate, Route } from "react-router-dom"; const ProtectedRoute = (props) => { const [isAuthenticated, setisAuthenticated] = useState(false); const checkALog = async () => {…