Replies: 3 comments 10 replies
-
I'd suggest you first console.log the data returned from session and then proceed by creating a type/interface for it. after doing so, use it like this Let me if that works. thanks |
Beta Was this translation helpful? Give feedback.
-
You could use the Session type provided with supabase:
To find this you can hover in VS Code, e.g: Then you can just start typing the name in and it can be auto-imported, e.g: You can inspect the type definition with Right click > Go to Type Definition // GoTrueClient.ts Then Right click > Go to Type Definition again on the Session interface //types.ts |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hey!
I'm refactoring an app to Typescript and I'm fairly new to TS and unsure how to handle these 2 errors. Any help or clarification would be appreciated!
"Argument of type 'Session | null' is not assignable to parameter of type 'SetStateAction'."
setSession(supabase.auth.session());
"Argument of type 'Session | null' is not assignable to parameter of type 'SetStateAction'.ts"
setSession(session);
Beta Was this translation helpful? Give feedback.
All reactions