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
rp_st
04/04/2023, 11:36 AM
hey @alotropico
The doesSessionExist function is not meant do be used instead a render function.
rp_st
04/04/2023, 11:37 AM
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_st
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