Skip to content

chore: update RSC demo with new router syntax #1339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 4, 2022
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 demos/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"ntl": "ntl-internal"
},
"dependencies": {
"next": "^12.1.5-canary.2",
"next": "^12.1.7-canary.1",
"react": "18.0.0",
"react-dom": "18.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions demos/server-components/netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build]
command = "npm run build"
publish = ".next"
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../.."

[build.environment]
NEXT_USE_NETLIFY_EDGE = "true"
Expand Down
5 changes: 5 additions & 0 deletions demos/server-components/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
module.exports = {
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
experimental: {
runtime: 'edge',
serverComponents: true,
Expand Down
2 changes: 1 addition & 1 deletion demos/server-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"private": true,
"dependencies": {
"ms": "2.1.3",
"next": "^12.1.5-canary.2",
"next": "^12.1.7-canary.1",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
Expand Down
12 changes: 8 additions & 4 deletions demos/server-components/pages/item.server.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

import ItemPage from '../components/item.server'

export default function Item({ router }) {
const { id } = router.query
export default function Item({ id }) {
return <ItemPage id={id} />
}

export const config = {
runtime: 'edge',
export async function getServerSideProps({ query }) {
return {
props: {
id: query.id
}
}
}
Loading