Loading data in components #10051
-
Hi all, pretty new to Remix and I'm building a dashboard that displays a few components. Previously I had a loader that gave me all the data I needed and then passed the data to the components as props. However, my dashboard is getting more complicated and I'm starting to see some latency. I'd like to fetch the data individually in parallel for each component and just display a loading skeleton so I don't have to wait for all the data to start rendering. What is the recommended way of doing this in Remix? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Streaming is what you're looking for. https://remix.run/docs/en/main/guides/streaming This gets better with Single Fetch, which allows you to nest promises and resolve them one by one on the client. https://remix.run/docs/en/main/guides/single-fetch#single-fetch |
Beta Was this translation helpful? Give feedback.
Streaming is what you're looking for. https://remix.run/docs/en/main/guides/streaming
This gets better with Single Fetch, which allows you to nest promises and resolve them one by one on the client. https://remix.run/docs/en/main/guides/single-fetch#single-fetch