Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the RootLayout component correctly.
NextJS
import [1] from './layout';
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase names for component imports.
Importing a non-existent component name.
✗ Incorrect
The root layout component is usually named
RootLayout and imported with exact casing.2fill in blank
mediumComplete the code to define a route group folder named admin with its own layout.
NextJS
app/[1]/layout.tsx Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a folder name that does not match the intended route group.
Placing the layout file outside the route group folder.
✗ Incorrect
Route groups are folders like
admin that can have their own layouts in Next.js.3fill in blank
hardFix the error in the layout component export to make it a valid Next.js root layout.
NextJS
export default function [1]({ children }: { children: React.ReactNode }) { return <html><body>{children}</body></html>; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or camelCase names for the root layout component.
Not exporting the component as default.
✗ Incorrect
The root layout component should be named
RootLayout with exact casing to follow Next.js conventions.4fill in blank
hardFill both blanks to create a nested route group with its own layout and page.
NextJS
app/[1]/[2]/page.tsx
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of route group folders.
Using folder names that do not exist in the project.
✗ Incorrect
Nested route groups like
admin/dashboard allow separate layouts and pages for each section.5fill in blank
hardFill all three blanks to complete a root layout that wraps a route group layout and renders children.
NextJS
export default function [1]({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <body> <[2]> {children} </[3]> </body> </html> ); }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatched opening and closing tags.
Incorrect function or component names.
✗ Incorrect
The root layout wraps the
AdminLayout component which renders the children inside the body.