Hydration error when streaming data from data loader
Hello,
I am facing an hydration error when I try to use an unresolved promise in the route loader. It happens on page load, not on hmr.
I was doing some basic tests so the code is very close to the boilerplate :
Then in the component :
const { user, postsPromise } = Route.useLoaderData()
and :
Do you know why I am getting this error? I was thinking this was basic usage of streaming, but I may have put stuff together in the wrong way as those are my first steps with TS start and TS router.
Thank you!2 Replies
eastern-cyan•7d ago
you need to either use
Await
or reacts use
in the componentmute-goldOP•7d ago
thank you very much! sorry this one was dumb 🫣 my bad