may be I haven't set it up correctly?
# help
t
may be I haven't set it up correctly?
s
What library is
AuthProvider
from?
Or what does the code look like for it?
t
It's a function that I have it uses useContext
it's not a library
s
Looking at that, you shouldn't need to provide any props to
<AuthProvider>
, since you're already passing them in at the parent level
t
oh yeah? sorry I feel that I am out of my depth here.... but need to do this TS refactor
thank you! I'll try and remove that supabase prop
s
No worries. For reference, I've got something similar for my provider (react-native example, but not much different from a regular react example)
Then, I just have
<SupabaseWrapper>
at my
App.tsx
without any props
t
very concise code. there isn't much of ts help for supabase yet... I tried looking... for docs
s
Supabase typescript isn't that much different from regular JS, but TS itself can take a while to get used to. The only TS parts of my screenshot are the
FC
definition (which isn't Supabase specific) and adding
AsyncStorage as any
(which was a workaround to stop TS complaining at the time I wrote this code). The main difference is that you can add types to queries which will tell it what the returned data looks like:
Copy code
ts
interface ISomeDataStructure {
  image_url: string;
  created_at: Date;
}

SupabaseClient
  .from<ISomeDataStructure>("my_table")
  .select("image_url, created_at")
By adding
<ISomeDataStructure>
after
.from
, VSCode will be able to tell you what properties are available in your data. Everything else is just JS.