mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This ensures we don't reference the wrong fetch global bypassing react's patched fetch so that it can properly fallback to react's fetch deduping when next cache is disabled for a specific fetch. x-ref: [slack thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1684518670927189?thread_ts=1682974724.765039&cid=C042LHPJ1NX) fixes: https://github.com/vercel/next.js/issues/50031
28 lines
532 B
JavaScript
28 lines
532 B
JavaScript
export default async function Page() {
|
|
const data1 = await fetch(
|
|
'https://next-data-api-endpoint.vercel.app/api/random?1',
|
|
{
|
|
next: {
|
|
revalidate: 0,
|
|
},
|
|
}
|
|
).then((res) => res.text())
|
|
|
|
const data2 = await fetch(
|
|
'https://next-data-api-endpoint.vercel.app/api/random?1',
|
|
{
|
|
next: {
|
|
revalidate: 0,
|
|
},
|
|
}
|
|
).then((res) => res.text())
|
|
|
|
return (
|
|
<>
|
|
<p>/react-fetch-deduping</p>
|
|
<p id="data-1">{data1}</p>
|
|
<p id="data-2">{data2}</p>
|
|
</>
|
|
)
|
|
}
|