Loading.tsx doesnt work
Answered
Asian black bear posted this in #help-forum
Asian black bearOP
I have a page.tsx in the same folder as loading.tsx, its all part of a tutorial
page.tsx
loading.tsx
when I refresh the page I can see "main page" the tutorial said that I should see "Loading"
why is it not working ?
page.tsx
export default async function Page() { return(<div>main page</div>);}
loading.tsx
export default function Loading() {
return <div>Loading</div>;
}
when I refresh the page I can see "main page" the tutorial said that I should see "Loading"
why is it not working ?
3 Replies
@Asian black bear I have a page.tsx in the same folder as loading.tsx, its all part of a tutorial
page.tsx
js
export default async function Page() { return(<div>main page</div>);}
loading.tsx
js
export default function Loading() {
return <div>Loading</div>;
}
when I refresh the page I can see "main page" the tutorial said that I should see "Loading"
why is it not working ?
well, your Page doesn't have any async operation that takes time
Answer
so that's why you don't see the loading UI but see the page immediately
@James4u well, your Page doesn't have any async operation that takes time
Asian black bearOP
that is it thank you, i made SetTimeInterval for 3 seconds and now I can see it , thanks ❤️