hi #174248
Replies: 3 comments 1 reply
-
It looks like your
import React, { useState, useEffect } from 'react';
import Login from '../Login';
import Dashboard from '../Dashboard';
const App = () => {
const [isAuthenticated, setIsAuthenticated] = useState(null);
useEffect(() => {
setIsAuthenticated(JSON.parse(localStorage.getItem('is_authenticated')));
}, []);
return (
<>
{isAuthenticated ? (
<Dashboard />
) : (
<Login setIsAuthenticated={setIsAuthenticated} />
)}
</>
);
};
export default App; |
Beta Was this translation helpful? Give feedback.
-
Hey there! 👋 Thanks for posting in the GitHub Community, @Hemalathavenkamsetty ! We're happy you're here. You are more likely to get a useful response if you are posting in the applicable category. The Accessibility category is a place for our community to discuss and provide feedback on the digital accessibility of GitHub products. Digital accessibility means that GitHub tools, and technologies, are designed and developed so that people with disabilities can use them. We’ve moved your post to our Programming Help 🧑💻 category, which is more appropriate for this type of discussion. Please review our guidelines about the Programming Help category for more information. |
Beta Was this translation helpful? Give feedback.
-
Hi @Hemalathavenkamsetty, we're happy you're here! You are more likely to get a useful response if you are explicit about what your project entails, giving a few more details might help someone give you a nudge in the right direction. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
GitHub Feature Area
Code Security
Body
`import React, { useState, useEffect } from 'react';
import Login from '../Login';
import Dashboard from '../Dashboard';
const App = () => {
const [isAuthenticated, setIsAuthenticated] = useState(null);
useEffect(() => {
setIsAuthenticated(JSON.parse(localStorage.getItem('is_authenticated')));
}, []);
return (
<>
{isAuthenticated ? (
) : (
)}
</>
);
};
export default App;`
Beta Was this translation helpful? Give feedback.
All reactions