How do i use Async and Client components in paralell
Unanswered
Asian black bear posted this in #help-forum
Asian black bearOP
Hey guys i have a main nav bar component which is async function as it fetches the users profile image and displays it, Along with this i am also using a dropdown menu within that needs a onclick function to redirect the user to logout. How can i use these together and whats the best practice for doing this. Thank you.
26 Replies
@Asian black bear Hey guys i have a main nav bar component which is async function as it fetches the users profile image and displays it, Along with this i am also using a dropdown menu within that needs a onclick function to redirect the user to logout. How can i use these together and whats the best practice for doing this. Thank you.
Elm sawfly
You can do it like this
Make a main file
Make a main file
Header.tsx in the component directoryThen make 2 another files
NavItems.tsx and another file name like: UserProfile.tsxIn the
And for the UI, u can make ur own changes
NavItems add your links, and in the UserProfile the logout logicAnd for the UI, u can make ur own changes
whatever suits u
Asian black bearOP
Ok thank you for this information, Right now i am trying to handle the logout logic using next-auth but it is giving me errors
ill send a screenshot of what it is saying
Elm sawfly
okay
Asian black bearOP
also i keep getting this
when i log into google it saves the data to my planetscale database but then when i clear the cache of the website then log back into the same account it wont let me
and gives me this error
you are logged out
Asian black bearOP
yeah exactly
Elm sawfly
that's why you need to login again
Asian black bearOP
and then when i try to log back in i get that error
yeah but i cant
this is a different issue sorry
when i do try and login i get the error shown above
Elm sawfly
No need for sorry
tbh never used nexauth, I only use Clerk
tbh never used nexauth, I only use Clerk
So can't help with that
@Asian black bear when i do try and login i get the error shown above
Elm sawfly
i see
Mabe you can create a new help-forum
Mabe you can create a new help-forum
that would be better
Asian black bearOP
Ok thank you 🙂
i will try what you said earlier also
@Asian black bear i will try what you said earlier also
Elm sawfly
Okay