Buckets:
silverwolf-x/project / test /e2e /app-dir /cache-components-errors /fixtures /default /app /sync-client-search /page.tsx
| 'use client' | |
| type SearchParams = { foo: string | string[] | undefined } | |
| export default function Page(props: { searchParams: Promise<SearchParams> }) { | |
| return ( | |
| <> | |
| <p> | |
| This page accesses searchParams synchronously. This does not trigger | |
| dynamic, and the build should succeed. In dev mode, we do log an error | |
| for the sync access though. | |
| </p> | |
| <SearchParamsReadingComponent searchParams={props.searchParams} /> | |
| </> | |
| ) | |
| } | |
| function SearchParamsReadingComponent({ | |
| searchParams, | |
| }: { | |
| searchParams: Promise<SearchParams> | |
| }) { | |
| // Cast to any as we removed UnsafeUnwrapped types, but still need to test with the sync access | |
| const fooParam = (searchParams as any).foo | |
| return ( | |
| <div> | |
| this component reads the `foo` search param:{' '} | |
| <span id="foo-param">{String(fooParam)}</span> | |
| </div> | |
| ) | |
| } | |
Xet Storage Details
- Size:
- 865 Bytes
- Xet hash:
- 11e2235c930ab6d24772fb0c5370a82e9353c5dc164fd07f5e18aead8da922ca
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.