react-code-dataset / next.js /packages /next /src /server /app-render /has-loading-component-in-tree.tsx
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
import type { LoaderTree } from '../lib/app-dir-module'
export function hasLoadingComponentInTree(tree: LoaderTree): boolean {
const [, parallelRoutes, { loading }] = tree
if (loading) {
return true
}
return Object.values(parallelRoutes).some((parallelRoute) =>
hasLoadingComponentInTree(parallelRoute)
) as boolean
}