react-code-dataset / next.js /packages /next /src /client /components /dev-root-http-access-fallback-boundary.tsx
Download next.js/packages/next/src/client/components/dev-root-http-access-fallback-boundary.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 636 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/client/components/dev-root-http-access-fallback-boundary.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/client/components/dev-root-http-access-fallback-boundary.tsx
-
curl -L -o dev-root-http-access-fallback-boundary.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/client/components/dev-root-http-access-fallback-boundary.tsx
636 Bytes
| 'use client' | |
| import React from 'react' | |
| import { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary' | |
| // TODO: error on using forbidden and unauthorized in root layout | |
| export function bailOnRootNotFound() { | |
| throw new Error('notFound() is not allowed to use in root layout') | |
| } | |
| function NotAllowedRootHTTPFallbackError() { | |
| bailOnRootNotFound() | |
| return null | |
| } | |
| export function DevRootHTTPAccessFallbackBoundary({ | |
| children, | |
| }: { | |
| children: React.ReactNode | |
| }) { | |
| return ( | |
| <HTTPAccessFallbackBoundary notFound={<NotAllowedRootHTTPFallbackError />}> | |
| {children} | |
| </HTTPAccessFallbackBoundary> | |
| ) | |
| } | |