Wrap and InnerWrap not properly wrapping router components (@tanstack/solid-start) #3744
Labels
package: solid-router
package: solid-start
revisit-after-devinxi
start
Everything about TanStack Start
Which project does this relate to?
Start
Describe the bug
The
Wrap
andInnerWrap
components (fromcreateTanstackRouter
) aren't, well, wrapping the app. In my particular case, this means theQueryClientProvider
context is not able to be accessed viauseQueryClient
, which is how I noticed it. You can see in the below screenshot that the two components get injected as siblings to the main component tree, rather than a part of. Potentially an SSR/hydration issue?A simple workaround is to just move
QueryClientProvider
to a route component and passqueryClient
there.Your Example Website or App
https://codesandbox.io/p/devbox/serverless-platform-3fyfd3?file=%2Fsrc%2Froutes%2F__root.tsx%3A11%2C1&workspaceId=ws_Kd4jkuu9beA8EHP9C8SzFs
Steps to Reproduce the Bug or Issue
Setup a router like the following:
Expected behavior
Wrap
and/orInnerWrap
should wrap the router's child components.Screenshots or Videos
You can see that the
Wrap
andInnerWrap
components exist but aren't in the correct position in the component hierarchy.the main portion of the component tree is folded under
CatchBoundary
Platform
Additional context
Workaround
Very simple workaround, just move the
QueryClientProvider
into the a route component ie.RootComponent
and pass thequeryClient
in there, either via import or via router context.The text was updated successfully, but these errors were encountered: