Home Page disappears upon login
stiltz46 opened this issue · 3 comments
stiltz46 commented
JustHarsh commented
I had a similar issue.
In index.js in your Navbar folder, replace
const fullName = `${user.firstName} ${user.lastName}`;
with
const fullName = user ? `${user.firstName} ${user.lastName}` : "";
It happens because your backend isn't running. So, it doesn't know what user is.
RPasquale commented
I made the above change and my error changed to this :
Uncaught TypeError: Cannot read properties of undefined (reading '63ed70a168cae755d301f8f0')
AboubakerIdHamide commented
If it's the error of find() is not afunction , you just need to destruct the friends from the redux state in Friends.jsx file
const { friends } = useSelector((state) => state.user.friends);