From 061f969b16916cc2ea0d3ae9711007b748ef80ab Mon Sep 17 00:00:00 2001 From: Henrik Wenz Date: Mon, 19 Sep 2022 10:16:07 +0200 Subject: [PATCH 1/2] Migrate to typescript --- .../components/{Nav.js => Nav.tsx} | 0 examples/with-prefetching/package.json | 5 +++++ .../pages/{_app.js => _app.tsx} | 3 ++- .../pages/{about.js => about.tsx} | 0 .../pages/{contact.js => contact.tsx} | 0 .../pages/{features.js => features.tsx} | 0 .../pages/{index.js => index.tsx} | 0 examples/with-prefetching/tsconfig.json | 20 +++++++++++++++++++ 8 files changed, 27 insertions(+), 1 deletion(-) rename examples/with-prefetching/components/{Nav.js => Nav.tsx} (100%) rename examples/with-prefetching/pages/{_app.js => _app.tsx} (52%) rename examples/with-prefetching/pages/{about.js => about.tsx} (100%) rename examples/with-prefetching/pages/{contact.js => contact.tsx} (100%) rename examples/with-prefetching/pages/{features.js => features.tsx} (100%) rename examples/with-prefetching/pages/{index.js => index.tsx} (100%) create mode 100644 examples/with-prefetching/tsconfig.json diff --git a/examples/with-prefetching/components/Nav.js b/examples/with-prefetching/components/Nav.tsx similarity index 100% rename from examples/with-prefetching/components/Nav.js rename to examples/with-prefetching/components/Nav.tsx diff --git a/examples/with-prefetching/package.json b/examples/with-prefetching/package.json index 349de02f4d84b..fd8f04fbac7f6 100644 --- a/examples/with-prefetching/package.json +++ b/examples/with-prefetching/package.json @@ -9,5 +9,10 @@ "next": "latest", "react": "^17.0.2", "react-dom": "^17.0.2" + }, + "devDependencies": { + "@types/node": "18.7.18", + "@types/react": "18.0.20", + "typescript": "4.8.3" } } diff --git a/examples/with-prefetching/pages/_app.js b/examples/with-prefetching/pages/_app.tsx similarity index 52% rename from examples/with-prefetching/pages/_app.js rename to examples/with-prefetching/pages/_app.tsx index bfcc5a452d248..8e57bb3bd813c 100644 --- a/examples/with-prefetching/pages/_app.js +++ b/examples/with-prefetching/pages/_app.tsx @@ -1,6 +1,7 @@ +import type { AppProps } from 'next/app' import Nav from '../components/Nav' -export default function App({ Component, pageProps }) { +export default function App({ Component, pageProps }: AppProps) { return ( <>