Why is my Supabase query in my Expo app coming back empty?

As part of our dev bootcamp my team and I have been thrown in the deep end for our final project and tasked with creating an app using tech that we’re unfamiliar with. We decided to spike Expo for front-end and Supabase for backend. I created a basic Expo project using the navigation template. Initialised the database in the project and imported the type files generated by Supabase. I’ve then tried to query the database in reviews.tsx but when I log ‘data’ I get an empty array back.

There are no obvious errors being thrown and the app runs as expected. Could anyone suggest where I might be going wrong? I can see on Supabase that the requests have been received.

P.S. I should probably also point out there is definitely data in the reviews table.

enter image description here

Screenshot for file structure context

enter image description here

reviews.tsx

import { StyleSheet, FlatList } from 'react-native';
import { Text, View } from '@/src/components/Themed';
import { useState,useEffect } from 'react';
import { supabase } from '@/src/lib/supabase';
import ReviewCard from '@/src/components/ReviewCard';

export default function TabTwoScreen() {
  const [reviews, setReviews] = useState<{ accommodation_id: number; created_at: string; rating: number; review_id: number; review_text: string; user_id: number; }[]>([]);

  useEffect(() => {
    getReviews();
  }, []);

  async function getReviews() {
    const { data } = await supabase.from("reviews").select('*')   
    console.log(supabase);
    
    setReviews(data as { accommodation_id: number; created_at: string; rating: number; review_id: number; review_text: string; user_id: number; }[]);
  }

  return (
    <View style={styles.container}>
      <Text>Reviews</Text>
    </View>
  );
}


const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  title: {
    fontSize: 20,
    fontWeight: 'bold',
  },
  separator: {
    marginVertical: 30,
    height: 1,
    width: '80%',
  },
});

supabase.ts

import { createClient } from '@supabase/supabase-js';


const supabaseUrl = 'https://vpnfpqsctxjafqxxizdf.supabase.co';
const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZwbmZwcXNjdHhqYWZxeHhpemRmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTU3ODY4NjIsImV4cCI6MjAzMTM2Mjg2Mn0.QCmxFGaLAro9w7e3sv9c2W_eZo62h8buk-X7qUVpTMs';

export const supabase = createClient(supabaseUrl, supabaseAnonKey);

database.types.ts

export type Json =
  | string
  | number
  | boolean
  | null
  | { [key: string]: Json | undefined }
  | Json[]

export type Database = {
  public: {
    Tables: {
      accommodation: {
        Row: {
          accommodation_id: number
          created_at: string
          description: string
          location: string
          owner: number
          phone: number
          photos: Json
          site_url: string
          title: string
        }
        Insert: {
          accommodation_id?: number
          created_at?: string
          description: string
          location: string
          owner: number
          phone: number
          photos: Json
          site_url: string
          title: string
        }
        Update: {
          accommodation_id?: number
          created_at?: string
          description?: string
          location?: string
          owner?: number
          phone?: number
          photos?: Json
          site_url?: string
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "accommodation_owner_fkey"
            columns: ["owner"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["user_id"]
          },
        ]
      }
      airlines: {
        Row: {
          Airline: string
          id: number
          "To - airport": string | null
        }
        Insert: {
          Airline: string
          id?: number
          "To - airport"?: string | null
        }
        Update: {
          Airline?: string
          id?: number
          "To - airport"?: string | null
        }
        Relationships: []
      }
      reviews: {
        Row: {
          accommodation_id: number
          created_at: string
          rating: number
          review_id: number
          review_text: string
          user_id: number
        }
        Insert: {
          accommodation_id: number
          created_at?: string
          rating: number
          review_id?: number
          review_text: string
          user_id: number
        }
        Update: {
          accommodation_id?: number
          created_at?: string
          rating?: number
          review_id?: number
          review_text?: string
          user_id?: number
        }
        Relationships: [
          {
            foreignKeyName: "reviews_accommodation_id_fkey"
            columns: ["accommodation_id"]
            isOneToOne: false
            referencedRelation: "accommodation"
            referencedColumns: ["accommodation_id"]
          },
          {
            foreignKeyName: "reviews_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["user_id"]
          },
        ]
      }
      trips: {
        Row: {
          accommodation_id: number | null
          ariline_id: number | null
          created_at: string
          destination: string | null
          trip_date_end: string | null
          trip_date_start: string | null
          trip_id: number
          trip_name: string | null
          user_id: number | null
        }
        Insert: {
          accommodation_id?: number | null
          ariline_id?: number | null
          created_at?: string
          destination?: string | null
          trip_date_end?: string | null
          trip_date_start?: string | null
          trip_id?: number
          trip_name?: string | null
          user_id?: number | null
        }
        Update: {
          accommodation_id?: number | null
          ariline_id?: number | null
          created_at?: string
          destination?: string | null
          trip_date_end?: string | null
          trip_date_start?: string | null
          trip_id?: number
          trip_name?: string | null
          user_id?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "trips_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["user_id"]
          },
        ]
      }
      users: {
        Row: {
          avatar_url: string | null
          created_at: string
          email: string
          firstname: string
          is_owner: boolean
          lastname: string | null
          user_id: number
          username: string
        }
        Insert: {
          avatar_url?: string | null
          created_at?: string
          email: string
          firstname: string
          is_owner?: boolean
          lastname?: string | null
          user_id?: number
          username: string
        }
        Update: {
          avatar_url?: string | null
          created_at?: string
          email?: string
          firstname?: string
          is_owner?: boolean
          lastname?: string | null
          user_id?: number
          username?: string
        }
        Relationships: []
      }
    }
    Views: {
      [_ in never]: never
    }
    Functions: {
      [_ in never]: never
    }
    Enums: {
      [_ in never]: never
    }
    CompositeTypes: {
      [_ in never]: never
    }
  }
}

type PublicSchema = Database[Extract<keyof Database, "public">]

export type Tables<
  PublicTableNameOrOptions extends
    | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
    | { schema: keyof Database },
  TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
    ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
        Database[PublicTableNameOrOptions["schema"]]["Views"])
    : never = never,
> = PublicTableNameOrOptions extends { schema: keyof Database }
  ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
      Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
      Row: infer R
    }
    ? R
    : never
  : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
        PublicSchema["Views"])
    ? (PublicSchema["Tables"] &
        PublicSchema["Views"])[PublicTableNameOrOptions] extends {
        Row: infer R
      }
      ? R
      : never
    : never

export type TablesInsert<
  PublicTableNameOrOptions extends
    | keyof PublicSchema["Tables"]
    | { schema: keyof Database },
  TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
    ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
    : never = never,
> = PublicTableNameOrOptions extends { schema: keyof Database }
  ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
      Insert: infer I
    }
    ? I
    : never
  : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
    ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
        Insert: infer I
      }
      ? I
      : never
    : never

export type TablesUpdate<
  PublicTableNameOrOptions extends
    | keyof PublicSchema["Tables"]
    | { schema: keyof Database },
  TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
    ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
    : never = never,
> = PublicTableNameOrOptions extends { schema: keyof Database }
  ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
      Update: infer U
    }
    ? U
    : never
  : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
    ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
        Update: infer U
      }
      ? U
      : never
    : never

export type Enums<
  PublicEnumNameOrOptions extends
    | keyof PublicSchema["Enums"]
    | { schema: keyof Database },
  EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
    ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
    : never = never,
> = PublicEnumNameOrOptions extends { schema: keyof Database }
  ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
  : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
    ? PublicSchema["Enums"][PublicEnumNameOrOptions]
    : never

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật