Nextjs13.使用并行路由时,error.tsx和loading.tsx都不起作用

aiqt4smr  于 2023-06-22  发布在  其他
关注(0)|答案(1)|浏览(156)

我开始使用Nextjs的新特性并行路由。
我的app结构如下所示:

[course]
├── @children
├── @hero
|   ├── page.tsx
|   ├── loading.tsx
|   └── error.tsx
└── layout.tsx

我看到@children和@hero插槽,但是loadingerror不起作用。
我尝试将async fetch添加到[course]/@hero/page.tsx,而不是显示[course]/@hero/loading.tsx的加载状态,它只是忽略它,我甚至看不到其他插槽(@children),直到它完成fetch。
也许我错过了一些非常重要的东西。救命啊!

63lcw9qa

63lcw9qa1#

在并行插槽内创建路由组

├── @hero
|   ├── (hack)
|   |   └── page.tsx
|   ├── loading.tsx
|   └── error.tsx
└── layout.tsx

相关问题