Migrating from the Pages Router — Concept Check
Questions on Migrating from the Pages Router. The two routers run side by side, so migration is incremental and route by route. The hard part is not the syntax — it is that data fetching and layouts work on different principles.
Questions in this quiz
8 questions on Migrating from the Pages Router — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.You have a Next.js application with a global CSS import in `pages/_app.js`. What should you do when migrating to the new router?
- ARemove the import entirely.
- BMove the import to `app/layout.tsx`.
- CMove the import to `app/page.tsx`.
- DKeep the import in `pages/_app.js`.
2.While migrating a route, you notice `getServerSideProps` is used. What should you do in the new router?
- AUse async/await directly in the component.
- BUse `getStaticProps` instead.
- CReplace with `getStaticPaths`.
- DKeep using `getServerSideProps`.
3.A developer migrates a route and uses `next/router` in `app/`. What issue might they encounter?
- A`next/router` will automatically convert to `next/navigation`.
- B`next/router` will cause a build error.
- C`next/router` will silently fail in `app/`.
- D`next/router` will work as expected in `app/`.
4.You are migrating a high-traffic route. What is the recommended approach?
- AMove it first for immediate feedback.
- BMove it without testing to save time.
- CMove it alongside low-traffic routes.
- DMove it last with extensive testing.
5.During migration, you notice a CSS-in-JS library is used. What should you consider?
- AIt should be removed entirely.
- BIt should be moved to `app/page.tsx`.
- CIt may need a registry or replacement.
- DIt will work without changes.
6.After upgrading from Next 14 to 15, what change affects dynamic routes?
- A`params` and `searchParams` are removed.
- B`params` and `searchParams` are synchronous.
- CDynamic routes are automatically cached.
- D`params` and `searchParams` are now Promises.
7.A developer claims `next/head` is used for metadata in `app/`. What is the correct approach?
- AUse `next/router` for metadata.
- BUse the `metadata` export instead.
- CReplace with `getServerSideProps`.
- DContinue using `next/head`.
8.When migrating, why should you avoid porting client-side data fetching verbatim?
- AIt improves performance.
- BIt increases complexity unnecessarily.
- CIt simplifies the migration process.
- DIt is required for compatibility.