Files
next.js/test/e2e/app-dir/use-offline/app/page.tsx
Andrew ClarkandGitHub 904501127c [experiment] Add useOffline flag with offline retry behavior (#92011)
**Current:**

1. https://github.com/vercel/next.js/pull/92011

**Up next:**

2. https://github.com/vercel/next.js/pull/92012

---

When a navigation, server action, or prefetch fails due to a network
error, instead of falling back to MPA navigation or surfacing an error,
the request blocks until connectivity is restored and then retries
automatically.

Offline detection works by treating any `fetch()` rejection as a network
error (server errors resolve with a status code, they don't reject).
Once offline, a polling loop does HEAD requests with exponential backoff
to detect when connectivity returns. Browser offline/online events also
feed into this loop. Successful fetches from other code paths can
short-circuit the loop if they happen to land first.

Follow-up work will add a `useOffline` hook so apps can show an offline
indicator to the user, and allow navigations to read from stale cache
entries while offline.

Gated behind `experimental.useOffline`.
2026-03-27 20:47:46 -04:00

11 lines
237 B
TypeScript

import { LinkAccordion } from '../components/link-accordion'
export default function Home() {
return (
<div id="home">
<h1>Home</h1>
<LinkAccordion href="/destination">Destination page</LinkAccordion>
</div>
)
}