Add a button to navigate to a route from the `router-devtools`.
Paths with dynamic path parameters will reuse the path parameters
from the current route. Only paths, where the current path
parameters are viable for a successful navigation will have this button
appear.
---
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
This change, makes it so that the `pendingComponent` is no longer
code-split by default when using the `automaticCodeSplitting` feature.
With this change, both the `loader` and `pendingComponent` will not be
code-split by _default_.
Exposes the `ClientOnly` component for preventing rendering & hydration
errors.
## Background
When you attempt to prevent content from rendering using something like
`typeof document !== 'undefined'` as that type of conditional will cause
hydration errors.
## API
```tsx
import { ClientOnly, createRoute } from '@tanstack/react-router'
import { Charts, FallbackCharts } from './charts-that-break-server-side-rendering'
const Route = createRoute({
// ... other route options
path: '/dashboard',
component: Dashboard,
})
function Dashboard() {
return (
<div>
<p>Dashboard</p>
<ClientOnly fallback={<FallbackCharts />}>
<Charts />
</ClientOnly>
</div>
)
}
```
> [!NOTE]
> This component as is (other than I removed the `children` as a
`function`) in production on [joggr.io](https://joggr.io)
---------
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: Ahmed Abdelbaset <A7med3bdulBaset@gmail.com>
Co-authored-by: Birk Skyum <birk.skyum@pm.me>
The migration to `router-core` made the `redirect` function
more restrictive since it _only_ used the `RegisteredRouter`.
This change makes it so that it accepts `AnyRouter` with it
defaulting to the `RegisteredRouter`. Also, `TTo` also
needed to be changed, since the first generic became optional.
fixes https://github.com/TanStack/router/issues/3680
It seems like `resolvedLocation` does not always point to the latest
location state in the ref callback; sometimes it points to the previous
location and `onRendered` is not triggered.
Also this fix detaches `onRendered` event from the scroll restoration
feature.
This change hashes the generated filnames for the JSON blobs that used
for static server function RPC calls.
So it goes from being
```
/__tsr/staticServerFnCache/app_routes_nav_posts_stub_tsx--loadPostServerFn_createServerFn_handler__-this-is-a-post-slug-.json
```
to
```
/__tsr/staticServerFnCache/00e9f7af882c994097f011e6492f2a30e8754bb0.json
```
This has an added benefit of ensuring that the `sha1` hash names are
always the same in character length.