https://supertokens.com/ logo
#support-questions
using session context
# support-questions
a

alotropico

04/04/2023, 11:31 AM
I am trying to use doesSessionExists in React, but the promise never resolves, and TS complains about using a Promise as a boolean. Am I doing something wrong?

https://cdn.discordapp.com/attachments/644849840475602944/1092773458611556413/image.png

r

rp

04/04/2023, 11:36 AM
hey @alotropico The doesSessionExist function is not meant do be used instead a render function.
Instead, use the SessionAuth wrapper, or call the doesSessionExist in a useEffect
a

alotropico

04/04/2023, 11:45 AM
Thank you. Do I have a sync state variable from within the SessionAuth? It's seems weird to create a state or context for that when the information is already available
r

rp

04/04/2023, 11:45 AM
it's a context provider.. so you can read info from the useSessionContext() hook. It's in our docs
a

alotropico

04/04/2023, 11:46 AM
Sounds perfect, thank you, I didn't know what to look for in the docs