How to debug loading.tsx
Unanswered
Saltwater Crocodile posted this in #help-forum
Saltwater CrocodileOP
I have a loading.tsx contain rive animation, but the problem its how we debug it, we obvious cant use throttle since not will rendered, nor use react dev tools, anyone any idea?
14 Replies
you can just do
await wait()
and next will render the file for the time beingawait new Promise(resolve => setTimeout(resolve, 500))
import { setTimeout } from 'node:timers/promises'
await setTimeout(1000)
import { promisify } from "node:util";
const wait = promisify(setTimeout)
await wait(1000)
any of these will work
Saltwater CrocodileOP
in the loading tsx or the page server?
page
Saltwater CrocodileOP
import React from 'react';
export default async function Page() {
// Simulate a delay before rendering the component
await new Promise(resolve => setTimeout(resolve, 5000));
return (
<div>group</div>
);
}
export default async function Page() {
// Simulate a delay before rendering the component
await new Promise(resolve => setTimeout(resolve, 5000));
return (
<div>group</div>
);
}
like this? hmm no loading.tsx maybe it error
wait loading should be rendered right even thogh we dont call the comonent? as i remembered
yea
Saltwater CrocodileOP
ahh sorry my bro its not working, i dont know why no loading
this is same chatgpt recomend
Saltwater CrocodileOP
bro thanks, i wrong config the rive
my badd