mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
After enabling Draft Mode, `router.refresh()` was incorrectly causing the page to crash and do a full page refresh. This PR fixes this case. Co-authored-by: Steven <[email protected]>
15 lines
254 B
TypeScript
15 lines
254 B
TypeScript
'use client'
|
|
|
|
import { useRouter } from 'next/navigation'
|
|
import React from 'react'
|
|
|
|
export function RouteRefresher() {
|
|
const router = useRouter()
|
|
|
|
return (
|
|
<button id="refresh" onClick={() => router.refresh()}>
|
|
Refresh
|
|
</button>
|
|
)
|
|
}
|