© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
5 replies
Silas

Does Supabase provide an Auth React+TypeScript example?

Hello, I followed https://supabase.com/docs/guides/auth/quickstarts/react but I'm struggling because the example doesn't pass eslint type checking. What's the recommended way to use supabase auth with react and typescript? The team I'm on is starting this project with strict type checking from the start.

We don't have anything complicated, just a blank project created with:

npm create vite@latest my-app -- --template react-ts
npm create vite@latest my-app -- --template react-ts


Here are the eslint errors we ran into:

# eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0
  37:5   error  Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator  @typescript-eslint/no-floating-promises
  48:18  error  Returning a void expression from an arrow function shorthand is forbidden. Please add braces to the arrow function                                                  @typescript-eslint/no-confusing-void-expression
# eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0
  37:5   error  Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator  @typescript-eslint/no-floating-promises
  48:18  error  Returning a void expression from an arrow function shorthand is forbidden. Please add braces to the arrow function                                                  @typescript-eslint/no-confusing-void-expression


Line 37 is line 13 in the example, the useEffect call body:

supabase.auth.getSession().then(({ data: { session } }) => {
  setSession(session)
})
supabase.auth.getSession().then(({ data: { session } }) => {
  setSession(session)
})


Line 48 is line 23 in the example, the call to:

return () => subscription.unsubscribe()
return () => subscription.unsubscribe()
Use Supabase Auth with React | Supabase Docs
Use Supabase Auth with React | Supabase Docs
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

React Native + Expo + Supabase Auth
SupabaseSSupabase / help-and-questions
3y ago
Up-to-date SvelteKit + Supabase auth example
SupabaseSSupabase / help-and-questions
3y ago
React Router V7 + Supabase + Polar Subscription Example?
SupabaseSSupabase / help-and-questions
2mo ago
Is there any good TypeScript React Supabase v2 email Auth tutorial?
SupabaseSSupabase / help-and-questions
4y ago