Javascript – Pending constant setting in React hook
my hook: export function useToken2() { const { data: session, status } = useSession(); const [token, setToken] = useState<string | null>(null); useEffect(() => { if (status === 'authenticated' && session?.accessToken) { logger('useEffect setToken') setToken(session.accessToken); } }, [status, session]); const tokenFn…