Unverified Commit eeff5557 authored by Shruthireddy04's avatar Shruthireddy04 Committed by GitHub

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: 's avatarShruthiKathula <147117812+ShruthiKathula@users.noreply.github.com>
Co-authored-by: 's avatarSam Ko <sam@vercel.com>
parent 064a5249
import "../style.css";
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
import HelloWorld from "../component/hello-world"; import HelloWorld from "./_component/hello-world";
export default function Home() { export default function Home() {
return ( return (
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
}, },
"dependencies": { "dependencies": {
"next": "latest", "next": "latest",
"react": "^18.2.0", "react": "^18.3.1",
"react-dom": "^18.2.0" "react-dom": "^18.3.1"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "18.11.5", "@types/node": "^20.14.11",
"@types/react": "18.2.8", "@types/react": "^18.3.3",
"@types/react-dom": "18.0.7", "@types/react-dom": "^18.3.0",
"typescript": "4.8.4" "typescript": "^5.5.3"
} }
} }
import { AppProps } from "next/app";
import "../style.css";
export default function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment