# Add DevJokes Tutorial: Reading and Writing Files
<img width="1318" alt="image"
src="https://github.com/user-attachments/assets/e6284dea-9596-42e5-b37a-c29ed56fa934"
/>
## Description
Adds a tutorial showing how to build a full-stack DevJokes app with
TanStack Start. Users learn to create server functions for reading and
writing to files, build React components, and implement data fetching
with TanStack Router.
## Key Features
- Server functions with `createServerFn`
- File-based data storage with Node.js `fs`
- Form handling and data validation
- Data refreshing with `router.invalidate()`
- Complete UI with Tailwind CSS
## Demo
https://youtu.be/zd0rtKbtlgU
## Reference
Complete code available at: https://github.com/shrutikapoor08/devjokes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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>
Closes#3655
Switch out our `qss` implementation from its manual solution
over to using `URLSearchParams` for handling
encoding/decoding while still retaining the same interface.
---------
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
In the "search params" guide, the usage of the variable
`allProductsRoute` has been changed to `Route` in the code-block
examples for consistency and clarity.
This makes the examples easier to follow since `Route` is used
throughout the rest of the documentation.
## Changes
1. **Fix createRootRoute syntax**: Updated all examples in the document
head management guide to use the correct `createRootRoute({...})` syntax
instead of the incorrect `createRootRoute()({...})` syntax.
2. **Fix HeadContent placement**: The previous commit corrected the code
example for Single-Page Applications to properly show the correct syntax
for creating a root route with HeadContent.
## Why these changes matter
- The incorrect syntax examples could lead to confusion for developers
implementing document head management in their applications
- These fixes ensure consistency throughout the documentation and
provide developers with the correct implementation patterns
- Proper documentation helps reduce support requests and improves
developer experience
## Technical details
- Fixed 5 instances of incorrect `createRootRoute()({...})` syntax
throughout the document
- Previously fixed the SPA example which had an incorrect API reference
These changes ensure that all code examples in the document head
management guide are correct and consistent with the actual API
implementation.
The `.matchRoute` method on the Router type page previously stated it
returns a `RouteMatch` object. In reality, it returns only the route
match's params.
This update corrects the return type in docs to reflect actual behavior.
Fix#3875