I am trying to use doesSessionExists in React, but...
# support-questions-legacy
a
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?
r
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
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
it's a context provider.. so you can read info from the useSessionContext() hook. It's in our docs
a
Sounds perfect, thank you, I didn't know what to look for in the docs