Skip to content

Commit

Permalink
fix: ssr hydrate (#59)
Browse files Browse the repository at this point in the history
* fix: ssr hydrate

* fix: prettier

* Update src/sync/write_client_entry.ts

---------

Co-authored-by: xiaoxiao <xiaoxiao.lh@antgroup.com>
Co-authored-by: chencheng (云谦) <sorrycc@gmail.com>
  • Loading branch information
3 people authored Nov 19, 2024
1 parent 647abbb commit 665de67
Show file tree
Hide file tree
Showing 5 changed files with 3,002 additions and 274 deletions.
1 change: 1 addition & 0 deletions examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"preview": "tnf preview"
},
"dependencies": {
"@tanstack/start": "^1.82.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@umijs/tnf": "workspace:*"
Expand Down
38 changes: 24 additions & 14 deletions examples/ssr/src/pages/__root.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
import { Link, Outlet, createRootRoute } from '@umijs/tnf/router';
import { Meta } from '@tanstack/start';

export const Route = createRootRoute({
component: () => (
<>
<div>Hello</div>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/foo">Foo</Link>
</li>
</ul>
<Outlet />
</>
),
component: RootComponent,
});

function RootComponent() {
return (
<html lang="en">
<head>
<Meta />
</head>
<body>
<div>Hello</div>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/foo">Foo</Link>
</li>
</ul>
<Outlet />
</body>
</html>
);
}
Loading

0 comments on commit 665de67

Please sign in to comment.