c221fc4508
### What Introduce a `react-server` export condition of `next/navigation`, which only take effects in RSC layer. And it will only contain `notFound` and `redirect` related APIs, which can be shared in both server components and client components environment. This export excludes those APIs working with React context which are only working in client components. ### Why We fixed an issue bad alias for react-server condition of react itself in https://github.com/vercel/next.js/pull/61522/files#diff-ecb951c8d26893f6d1e4425a873b399d52346ef63eb90fba79d980cef2fabe8cL35 , this was a good fix. But we found that if you're using edge runtime with `next/navigation` it will error with bundling that you're attempted to import some client component hooks such as `useContext` from react. So we introduced a `react-server` version of `next/navigation` that doesn't interoplate with any client hooks, can we'll bundle that one instead of original `next/navigation` when you're using it in server components or app routes. Closes NEXT-2583 Closes NEXT-2519 Fixes #62187 |
||
---|---|---|
.. | ||
app | ||
handlers | ||
app-custom-route-base-path.test.ts | ||
app-custom-routes.test.ts | ||
helpers.ts | ||
next.config.js |