T
TanStack12mo ago
absent-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
adverse-sapphire
adverse-sapphire12mo ago
its probably the defaultPendingMinMs
adverse-sapphire
adverse-sapphire12mo ago
No description
absent-sapphire
absent-sapphireOP12mo 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?
adverse-sapphire
adverse-sapphire12mo ago
depends on the use case
absent-sapphire
absent-sapphireOP12mo ago
Wouldn't 0 be a better default in most users?
initial-rose
initial-rose12mo ago
Probably… But still depends on preloading etc

Did you find this page helpful?