Inspired by the Supabase docs, I have this code in a React Native app:
useEffect(() => {
if (session?.user?.id === null) return
const channel = supabase
.channel('value-db-changes', { selfBroadcast: true })
.on(
'postgres_changes',
{
event: 'UPDATE',
schema: 'public',
table: 'messages',
filter: `user_id=${session?.user?.id}`
},
(payload) => console.log('Supabase change', payload)
)
?.subscribe()
}, [session?.user?.id])
VSCode warns me that Property 'subscribe' does not exist on type 'never'
and the console.log
never shows as I edit rows in my database.