MCPcopy Create free account
hub / github.com/vercel/examples / RefreshButton

Function RefreshButton

storage/postgres-drizzle/components/refresh-button.tsx:6–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { useTransition } from 'react'
5
6export default function RefreshButton() {
7 const router = useRouter()
8 const [isPending, startTransition] = useTransition()
9
10 return (
11 <button
12 className={`${
13 isPending ? 'cursor-not-allowed text-gray-400' : ''
14 } text-sm text-gray-500 hover:text-gray-900`}
15 disabled={isPending}
16 onClick={() => {
17 startTransition(() => {
18 router.refresh()
19 })
20 }}
21 >
22 {isPending ? 'Refreshing...' : 'Refresh'}
23 </button>
24 )
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected