#How can we stream html response in Start?

4 messages · Page 1 of 1 (latest)

steep bay
#

In next.js, we can do like this:

function MyComponent() {
  const dataPromise = fetchData()

  return (
    <ShellComponent />
    <Suspense fallback={<div>Loading...</div>}>
      <ComponentWaitingOnData promise={dataPromise} />
    </Suspense>
  )
}

This way, ShellCompnent and fallback of suspense boundary is streamed to the client straight away without any wait. And ComponentWaitingData is streamed when its data is available. How can we do the same in Tanstack Start? Thank you

opal frigate
# steep bay In next.js, we can do like this: ``` function MyComponent() { const dataPromi...

TanStack Router is designed to run loaders in parallel and wait for all of them to resolve before rendering the next route. This is great most of the time, but occasionally, you may want to show the u...

[!IMPORTANT] This guide is geared towards external state management libraries and their integration with TanStack Router for data fetching, ssr, hydration/dehydration and streaming. If you haven't rea...

tidal token
#

yeah, you can return promises from loaders, and either use Await or use(promise)

#

i think use is preferred