Skip to content

Commit 06c3976

Browse files
committed
bug
1 parent 3542857 commit 06c3976

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

examples/react-query/pages/use-query.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { useCallback, useState } from "react"
22
import Head from "next/head"
3-
import { useQuery } from "@supabase-cache-helpers/postgrest-react-query"
3+
import {
4+
useDeleteMutation,
5+
useQuery,
6+
} from "@supabase-cache-helpers/postgrest-react-query"
47
import { useSupabaseClient } from "@supabase/auth-helpers-react"
58
import { z } from "zod"
69

@@ -21,6 +24,8 @@ import { Button } from "@/components/ui/button"
2124

2225
export default function UseInfiniteScrollQueryPage() {
2326
const supabase = useSupabaseClient<Database>()
27+
// I lose typesaftey here...
28+
const {} = useDeleteMutation(supabase.from("contact"), ["id"])
2429
const { data: contacts } = useQuery(
2530
supabase
2631
.from("contact")
@@ -77,15 +82,15 @@ export default function UseInfiniteScrollQueryPage() {
7782
</div>
7883
<ul role="list" className="divide-y divide-gray-200">
7984
{(contacts ?? []).map((contact) => (
80-
<li key={contact.id} className="py-4 px-2">
85+
<li key={contact.id} className="px-2 py-4">
8186
<div className="flex items-center space-x-4">
8287
<Avatar>
8388
<AvatarImage src={null} alt={contact.username} />
8489
<AvatarFallback>
8590
{contact.username.slice(0, 2)}
8691
</AvatarFallback>
8792
</Avatar>
88-
<div className="min-w-0 flex-1">
93+
<div className="flex-1 min-w-0">
8994
<Small>{contact.username}</Small>
9095
<Subtle>{contact.continent}</Subtle>
9196
</div>

examples/react-query/tsconfig.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"compilerOptions": {
3-
"lib": ["dom", "dom.iterable", "esnext"],
3+
"lib": [
4+
"dom",
5+
"dom.iterable",
6+
"esnext"
7+
],
48
"allowJs": true,
59
"skipLibCheck": true,
610
"strict": false,
@@ -9,15 +13,23 @@
913
"incremental": true,
1014
"esModuleInterop": true,
1115
"module": "esnext",
12-
"moduleResolution": "node",
16+
"moduleResolution": "Bundler",
1317
"resolveJsonModule": true,
1418
"isolatedModules": true,
1519
"jsx": "preserve",
1620
"baseUrl": ".",
1721
"paths": {
18-
"@/*": ["./*"]
22+
"@/*": [
23+
"./*"
24+
]
1925
}
2026
},
21-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
22-
"exclude": ["node_modules"]
23-
}
27+
"include": [
28+
"next-env.d.ts",
29+
"**/*.ts",
30+
"**/*.tsx"
31+
],
32+
"exclude": [
33+
"node_modules"
34+
]
35+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"extends": "@supabase-cache-helpers/tsconfig/react-library.json",
3-
"include": ["**/*.ts"],
4-
"exclude": ["node_modules"]
5-
}
3+
"include": [
4+
"**/*.ts"
5+
],
6+
"exclude": [
7+
"node_modules"
8+
]
9+
}

0 commit comments

Comments
 (0)