skip to Main Content

How can I build a private route system in Reactjs?

my App declaration looks like this function App() { const [loggedIn, setLoggedIn] = useState(false); const [username, setUsername] = useState('') const [userId, setUserId] = useState(0) const [error, setError] = useState('') useEffect(() => { fetchSessionData(setLoggedIn, setUsername, setUserId, setError) }, []) fetchSessionData calls…

VIEW QUESTION
Back To Top
Search