Skip to content

Commit eeff555

Browse files
Shruthireddy04ShruthiKathulasamcx
authored
Updated/Migrated next-css example to the App Router (#67942)
This PR updates the next-css example to use the App Router. Here are the changes that have been made: Renamed the "pages" folder to "app" folder. Updated the file index.tsx to page.tsx to align with App Router. Updated the file _app.tsx to layout.tsx to align with App Router. Updated the components folder to align with App Router and made components folder private. Updated package.json to use the latest version. cc: @samcx --------- Co-authored-by: ShruthiKathula <[email protected]> Co-authored-by: Sam Ko <[email protected]>
1 parent 064a524 commit eeff555

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

examples/next-css/app/layout.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import "../style.css";
2+
3+
export default function RootLayout({
4+
children,
5+
}: {
6+
children: React.ReactNode;
7+
}) {
8+
return (
9+
<html lang="en">
10+
<body>{children}</body>
11+
</html>
12+
);
13+
}

examples/next-css/pages/index.tsx renamed to examples/next-css/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import HelloWorld from "../component/hello-world";
1+
import HelloWorld from "./_component/hello-world";
22

33
export default function Home() {
44
return (

examples/next-css/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
},
88
"dependencies": {
99
"next": "latest",
10-
"react": "^18.2.0",
11-
"react-dom": "^18.2.0"
10+
"react": "^18.3.1",
11+
"react-dom": "^18.3.1"
1212
},
1313
"devDependencies": {
14-
"@types/node": "18.11.5",
15-
"@types/react": "18.2.8",
16-
"@types/react-dom": "18.0.7",
17-
"typescript": "4.8.4"
14+
"@types/node": "^20.14.11",
15+
"@types/react": "^18.3.3",
16+
"@types/react-dom": "^18.3.0",
17+
"typescript": "^5.5.3"
1818
}
1919
}

examples/next-css/pages/_app.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)