typescript is not assignable to type even though d...
# help-and-questions
v
This may not be strictly supabase related. Trying to learn TS and use the supabase TS defintions. Things seem to work untill I want to actually use a component that uses the supabase types. I get an error stating
Copy code
Type '{ [x: string]: any; }[]' is not assignable to type '{ contact_point: string....
I'm wondering how I can use these magical supabase types without TS saying "no sir"
Copy code
js

type TaasTypes = Database["public"]["Tables"]["taas"]["Row"];

function TaaS({ tasks }: { tasks: TaasTypes[] }) { <- no error here
    return (
        <>
            {tasks.map((task) => (
                <div key={task.id}>
                    <h3>{task.task}</h3>
                    <p>{task.description}</p>
                    <p>Kontaktpunkt: {task.contact_point}</p>
                </div>
            ))}
        </>
    );
}

const Kundeportal = async () => {
    // Start supabase server client
    const supabase = serverClient();

    
    // Henter TaaS timer profilen kan se
    const { data: taas, error: taasError } = await supabase
        .from("taas")
        .select(`*`);
  
    return (<>
      {taas ? <TaaS tasks={taas} /> : <p>Ingen TaaS-timer tilgjengelig</p>} <- ERORR is here
    </>)
}
Tried something like this
Copy code
js
const { data: taas , error: taasError } = await supabase
        .from<TaasTypes>("taas")
        .select(`*`);
adding <> behind types gives error
Copy code
No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments.ts(2743)