mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? Our current logic of detecting if a route allows dynamic params or not (`fallback`) is flawed, and this PR fixes it. ### Why? Right now, if no `generateStaticParams` is specified we return `fallback: undefined` during dev. However, for an app with multiple params, it may have multiple `generateStaticParams` defined in different levels. If some level isn't covered by any `generateStaticParams`, we still can't determine the fallback value. ### How? I added a naive implementation to check if all params are covered by `generateStaticParams` in the current or inner layers. Closes NEXT-946
10 lines
194 B
JavaScript
10 lines
194 B
JavaScript
'use client'
|
|
|
|
import { useRouter } from 'next/navigation'
|
|
|
|
export default function Refresh() {
|
|
const router = useRouter()
|
|
|
|
return <button onClick={() => router.refresh()}>Refresh</button>
|
|
}
|