Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"cwd": "${workspaceFolder}/examples/basic-nextjs-15"
"cwd": "${workspaceFolder}/examples/nextjs-15-basic"
},
{
"name": "Next.js: debug client-side",
Expand Down
8 changes: 4 additions & 4 deletions examples/nextjs-15-basic/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/nextjs-15-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@rownd/next": "file:../../packages/next/rownd-next-2.6.0.tgz",
"@rownd/next": "2.7.4",
"next": "15.0.4",
"react": "^19.0.0",
"react-dom": "^19.0.0"
Expand Down
33 changes: 33 additions & 0 deletions examples/nextjs-15-basic/src/app/custom/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Fallback from '@/components/Fallback';
import { getRowndUser } from '@rownd/next/server';
import { RowndServerStateSync, withRowndRequireSignIn } from '@rownd/next';
import { cookies } from 'next/headers';

async function CustomPage() {
const data = await fetch('https://jsonplaceholder.typicode.com/posts');
const posts: { id: number; title: string; body: string }[] = await data.json();
const user = await getRowndUser(cookies);

return (
<>
<div className="flex justify-center flex-col w-50 ">
<h1 className="text-2xl font-bold">Custom page</h1>
<h3>User ID: {JSON.stringify(user, null, 2)}</h3>
<Fallback />
<ul className="flex flex-col list-disc">
{posts
.filter((_, idx) => idx < 5)
.map((post) => (
<li className="flex flex-col p-2" key={post.id}>
<h2>{post.title}</h2>
<p>{post.body}</p>
</li>
))}
</ul>
</div>
<RowndServerStateSync />
</>
);
}

export default CustomPage;
Loading
Loading