T
TanStack2mo ago
gradual-turquoise

Dev workflow for building a pendingComponent?

How do you go about building your pendingComponent? I change pendingComponent to component whilst im developing / designing the loading state, then change it back to pendingComponent when I'm happy. I'm wondering if im missing something obvious?
5 Replies
optimistic-gold
optimistic-gold2mo ago
I’ve manually forced the pending state by setting a very long timer in beforeload or loader
export const Route = createFileRoute('/example')({
beforeLoad: async () => {
await new Promise(resolve => setTimeout(resolve, 100_000)) // 100s
}
export const Route = createFileRoute('/example')({
beforeLoad: async () => {
await new Promise(resolve => setTimeout(resolve, 100_000)) // 100s
}
optimistic-gold
optimistic-gold2mo ago
I normally just render the loading component as the route component until I'm done, then just swap it in. But depends what you are doing in the component
gradual-turquoise
gradual-turquoiseOP2mo ago
@ViewableGravy same here. Im wondering if its worth creating a PR to the docs to add this as a tip for future devs? 🤔
optimistic-gold
optimistic-gold2mo ago
Probably, gotta be careful putting too many “tips” in the docs though, otherwise the actual documentation get’s cluttered. Documentation is hard 😂
gradual-turquoise
gradual-turquoiseOP2mo ago
Yeh thats what I was thinking. Was wondering if its a useful enough "tip" to warrant it being in the docs.

Did you find this page helpful?