According to:
Nextjs documentation
https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming
image here
根据:此处为Nextjs Documentation https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming图片
i created a loading.js file for the page.
我为页面创建了一个loading.js文件。
what i want to do?
I want to be able to debug loading.js of any page without having to import it in a test page as a component.
我想做什么?我希望能够调试任何页面的loading.js,而不必将其作为组件导入到测试页面中。
why i can't do it?
when developing the nextjs app since the app runs locally i barely see the loading UI because the page loads really quick. (bandwith throttling doesn't really help for this)
为什么我做不到?在开发NextJS应用程序时,由于应用程序在本地运行,我几乎看不到加载UI,因为页面加载得非常快。(带宽限制对此没有帮助)
Is there any smart&easy technique to do that? Like stopping the network transaction of the browser etc.
有什么聪明而简单的方法可以做到这一点吗?如停止浏览器的网络交易等。
更多回答
优秀答案推荐
If you want to debug the LoadingSkeleton
, you could insert it in a page. If you really want to check the loading.js
, you could call an API route that waits for a long time before returning something.
如果要调试LoadingSkype,可以将其插入到页面中。如果您真的想要检查loading.js,您可以调用一个在返回之前等待很长时间的API路由。
更多回答
我是一名优秀的程序员,十分优秀!