Which project does this relate to?
Router
Describe the bug
wrapInSuspense is declared in router-core's shared route options, so it typechecks in both adapters, but only react-router actually implements it
react-router - match only gets a Suspense boundary when it needs one, and wrapInSuspense can force it either way:
|
const ResolvedSuspenseBoundary = |
|
// If we're on the root route, allow forcefully wrapping in suspense |
|
(!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) && |
|
(route.options.wrapInSuspense ?? |
|
PendingComponent ?? |
|
((route.options.errorComponent as any)?.preload || resolvedNoSsr)) |
|
? React.Suspense |
|
: SafeFragment |
solid-router - unconditional, route.options.wrapInSuspense is never read anywhere in the package:
|
const ResolvedSuspenseBoundary = () => Solid.Suspense |
proposed fix
port the react-router condition to solid-router/src/Match.tsx, something like:
const ResolvedSuspenseBoundary = () =>
(!route().isRoot || route().options.wrapInSuspense || resolvedNoSsr) &&
(route().options.wrapInSuspense ??
(resolvePendingComponent() || resolvedNoSsr))
? Solid.Suspense
: SafeFragment
Complete minimal reproducer
https://github.com/teidesu/tanstack-solid-router-wrapinsuspense-repro
Steps to Reproduce the Bug
- use
wrapInSuspense: false, and add some suspenses
- notice how it's not respected
Expected behavior
wrapInSuspense behaves like react-router
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.170.17
- OS: macos
- Browser: chrome, firefox
- Browser Version: latest
- Bundler: vite
- Bundler Version: 7.1.3
Additional context
this was already raised in #5855 but closed without resolution due to lack of repro. im not entirely sure what kind of repro this needs since this is a straight up missing feature, but attached one regardless
Which project does this relate to?
Router
Describe the bug
wrapInSuspense is declared in router-core's shared route options, so it typechecks in both adapters, but only react-router actually implements it
react-router - match only gets a Suspense boundary when it needs one, and wrapInSuspense can force it either way:
router/packages/react-router/src/Match.tsx
Lines 161 to 168 in 0b178a7
solid-router - unconditional, route.options.wrapInSuspense is never read anywhere in the package:
router/packages/solid-router/src/Match.tsx
Line 94 in 0b178a7
proposed fix
port the react-router condition to
solid-router/src/Match.tsx, something like:Complete minimal reproducer
https://github.com/teidesu/tanstack-solid-router-wrapinsuspense-repro
Steps to Reproduce the Bug
wrapInSuspense: false, and add some suspensesExpected behavior
wrapInSuspense behaves like react-router
Screenshots or Videos
No response
Platform
Additional context
this was already raised in #5855 but closed without resolution due to lack of repro. im not entirely sure what kind of repro this needs since this is a straight up missing feature, but attached one regardless