Why username is logging undefined? i have a user object which is coming from another screen by navigation and route but i want to call the username from that user object so I tried to do console.log(user.username) but then it logs undefined and when I only log user then it gives whole user result as expected but then why is it giving username undefined?
const { user } = route.params;
console.log(user.username)
console.log(user)
User Log Result:
LOG [{"_id": "63c42922dc60a84421e8f843", "photos": [[Object]], "profileImg": "Image uri here", "username": "Test"}]