T
TanStack15mo ago
foreign-sapphire

Slow first paint when using a loader

When using a loader in any page the first paint gets delayed 500ms, this is really noticeable, look at this based on this examples home page: If i add console.log(performance.now()); to main.tsx and in the component in routes/index.tsx i get the following timings (image 1) But if we simply add this to the route: loader: () => {} We get the following results (image 2) Here we can see almost a 500ms slowdown by just adding the loader, i would guess this is an error? or is there other reason its taking so long to render?
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user
No description
No description
6 Replies
metropolitan-bronze
metropolitan-bronze15mo ago
its probably the defaultPendingMinMs
metropolitan-bronze
metropolitan-bronze15mo ago
No description
foreign-sapphire
foreign-sapphireOP15mo ago
yup that was it, missed that setting, any reason for it to be 500 by default? or any reason not to put it to 0?
metropolitan-bronze
metropolitan-bronze15mo ago
depends on the use case
foreign-sapphire
foreign-sapphireOP15mo ago
Wouldn't 0 be a better default in most users?
correct-apricot
correct-apricot15mo ago
Probably… But still depends on preloading etc

Did you find this page helpful?