mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
The server form of refresh() is used to re-render all the dynamic data on the current page. Unlike updateTag/revalidateTag, it does not affect any cached data, so the client cache should not evict any of its entries.
18 lines
288 B
TypeScript
18 lines
288 B
TypeScript
'use client'
|
|
|
|
import { useRouter } from 'next/navigation'
|
|
|
|
export function ClientRefreshButton() {
|
|
const router = useRouter()
|
|
return (
|
|
<button
|
|
id="client-refresh-button"
|
|
onClick={() => {
|
|
router.refresh()
|
|
}}
|
|
>
|
|
Client refresh
|
|
</button>
|
|
)
|
|
}
|