ant-design layout shift bug if add loading.tsx in next app

dwbf0jvd  于 4个月前  发布在  其他
关注(0)|答案(4)|浏览(106)

https://stackblitz.com/~/github.com/DmitryLebedevDev/antd-layout-shift-bug

Steps to reproduce

reload page many times

What is expected?

after loading -> view html skeleton -> expected page

What is actually happening?

after loading -> view html skeleton -> layout shift -> expected page
| Environment | Info |
| ------------ | ------------ |
| antd | 5.13.2 |
| React | ^18 |
| System | linux |
| Browser | chrome |

z8dt9xmd

z8dt9xmd1#

Seems cache will not catch any style during useServerInsertedHTML when loading.tsx is added.

fhg3lkii

fhg3lkii2#

a temporary solution
render components with wrong view in loading.tsx

kulphzqa

kulphzqa3#

I have the same problem too.
but, this issue only exists for me in dynamic routes.

k5hmc34c

k5hmc34c4#

I have the same issue when I fetch data on a function page.
export default async function Page() { const data = await getData(); return (<Input />) }

相关问题