rsnext/packages/next/client/components/hooks-client-context.ts
Jiachi Liu f5a89eb00a
Dont apply existing externals path changing to rsc layers (#41744)
We have existing rule for pages ssr that `next/dist/server` and
`next/dist/shared` will not be bundled, but we shouldn't apply it to rsc
layers since the they should bundle the dependencies in their own way.

Adding a test that using `next/head` in the page, since head is exported
from `next/dist/shared`, expect the page is not broken but we don't
expect it's working

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-10-24 18:00:44 -07:00

15 lines
582 B
TypeScript

'use client'
import { createContext } from 'react'
export const SearchParamsContext = createContext<URLSearchParams>(null as any)
export const PathnameContext = createContext<string>(null as any)
export const ParamsContext = createContext(null as any)
export const LayoutSegmentsContext = createContext(null as any)
if (process.env.NODE_ENV !== 'production') {
SearchParamsContext.displayName = 'SearchParamsContext'
PathnameContext.displayName = 'PathnameContext'
ParamsContext.displayName = 'ParamsContext'
LayoutSegmentsContext.displayName = 'LayoutSegmentsContext'
}