Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/start/framework/react/migrate-from-next-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,29 @@ function Component() {

Learn more about the [Links](/router/latest/docs/framework/react/guide/navigation#link-component).

### Images

Next.js uses the `next/image` component for optimized images. In TanStack Start, you can use the package called [Unpic](https://unpic.pics/) for similar functionality
and almost a drop-in replacement.

```tsx
import Image from "next/image" // [!code --]
import { Image } from "@unpic/react"; // [!code ++]
function Component() {
return (
<Image
src="/path/to/image.jpg"
alt="Description"
width="600" // [!code --]
height="400" // [!code --]
width={600} // [!code ++]
height={400} // [!code ++]
/>
)
}
Comment on lines +309 to +326
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add install step for Unpic before showing usage.

The new snippet imports @unpic/react, but we never tell readers to install it. Following the guide as written will crash at build time with “Cannot resolve module '@unpic/react'.” Please insert an install command (e.g. npm install @unpic/react) in this section before the code sample so the migration instructions are complete.

 ### Images

 Next.js uses the `next/image` component for optimized images. In TanStack Start, you can use the package called [Unpic](https://unpic.pics/) for similar functionality
 and almost a drop-in replacement.

+Install the React component:
+
+```sh
+npm install @unpic/react
+```
+
 ```tsx
 import Image from "next/image" // [!code --]
 import { Image } from "@unpic/react"; // [!code ++]
🤖 Prompt for AI Agents
In docs/start/framework/react/migrate-from-next-js.md around lines 309 to 326,
the example imports @unpic/react but never tells readers to install it; add an
install step immediately before the code block (e.g., a short sentence and the
npm install @unpic/react command, with equivalent yarn/pnpm examples if you
prefer) so users can install the package before trying the snippet and avoid the
“Cannot resolve module '@unpic/react'” build error.

```


### Server ~Actions~ Functions

```tsx
Expand Down