Skip to content

Commit

Permalink
update react remove properties to support app route (#68324)
Browse files Browse the repository at this point in the history
This PR updates the react-remove-properties example to use the App
Router. Here are the changes that have been made:

Renamed the "pages" folder to the "app" folder.
Updated the routing for / files to align with the App Router.
Added the layout.tsx file as part of the App Router.
CC @samcx

---------

Co-authored-by: niket <[email protected]>
Co-authored-by: samcx <[email protected]>
  • Loading branch information
3 people authored Jul 30, 2024
1 parent 528b6af commit dea722d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
16 changes: 16 additions & 0 deletions examples/react-remove-properties/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const metadata = {
title: "Next.js",
description: "Generated by Next.js",
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function Index() {
export default function Home() {
return (
<div data-test-id="1" data-custom="1a">
<div data-custom="2">
Expand Down
12 changes: 6 additions & 6 deletions examples/react-remove-properties/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
},
"dependencies": {
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^18.11.5",
"@types/react": "^18.0.23",
"@types/react-dom": "^18.0.7",
"typescript": "^4.8.4"
"@types/node": "^22.0.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"typescript": "^5.5.4"
}
}

0 comments on commit dea722d

Please sign in to comment.