Files
Janka UrygaandGitHub 5de53fb106 [App Shells] Allow root params in app shells (#94738)
Server-side part of #94773. We remove previously added code that
excludes root params from the ShellStatic stage and let them resolve
there. We also add some special cases for `params` objects that consist
entirely of root params - those are allowed to resolve as well.
2026-06-17 13:22:57 +00:00

26 lines
484 B
TypeScript

'use client'
import Link, { useLinkStatus } from 'next/link'
import { ComponentProps } from 'react'
export function LinkWithPendingIndicator({
children,
...props
}: ComponentProps<typeof Link>) {
return (
<Link {...props}>
{children} <PendingIndicator />
</Link>
)
}
function PendingIndicator() {
const { pending } = useLinkStatus()
if (!pending) return null
return (
<span data-pending style={{ color: 'gray' }}>
Pending...
</span>
)
}