Skip to content

Commit 3a1a311

Browse files
soartec-labMichaelDeBoeybrophdawg11
authored
docs(upgrading/remix): show entry files diff (#12158)
Co-authored-by: Michaël De Boey <[email protected]> Co-authored-by: Matt Brophy <[email protected]>
1 parent a934cc9 commit 3a1a311

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
- SimenB
241241
- SkayuX
242242
- smithki
243+
- soartec-lab
243244
- sorrycc
244245
- souzasmatheus
245246
- srmagura

docs/upgrading/remix.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,29 @@ export const routes: RouteConfig = flatRoutes();
8989

9090
### Step 6 - Rename components in entry files
9191

92-
If you have an `entry.server.tsx` and/or an `entry.client.tsx` file in your application, you will need to rename the main components in this files:
92+
If you have an `entry.server.tsx` and/or an `entry.client.tsx` file in your application, you will need to update the main components in these files:
93+
94+
```diff filename=app/entry.server.tsx
95+
- import { RemixServer } from "@remix-run/react";
96+
+ import { ServerRouter } from "react-router";
97+
98+
- <RemixServer context={remixContext} url={request.url} />,
99+
+ <ServerRouter context={remixContext} url={request.url} />,
100+
```
101+
102+
```diff filename=app/entry.client.tsx
103+
- import { RemixBrowser } from "@remix-run/react";
104+
+ import { HydratedRouter } from "react-router/dom";
105+
106+
hydrateRoot(
107+
document,
108+
<StrictMode>
109+
- <RemixBrowser />
110+
+ <HydratedRouter />
111+
</StrictMode>,
112+
);
113+
```
93114

94-
| Entry File | Remix v2 Component | | React Router v7 Component |
95-
| ------------------ | ------------------ | --- | ------------------------- |
96-
| `entry.server.tsx` | `<RemixServer>` | ➡️ | `<ServerRouter>` |
97-
| `entry.client.stx` | `<RemixBrowser>` | ➡️ | `<HydratedRouter>` |
98115

99116
### Step 7 - Update types for `AppLoadContext`
100117

0 commit comments

Comments
 (0)