From the course: Learning Next.js

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Challenge: Set up a file-based system with zero config

Challenge: Set up a file-based system with zero config

From the course: Learning Next.js

Challenge: Set up a file-based system with zero config

(upbeat electronic music) - [Instructor] For this challenge, I'd like to show you first the example of a navigation system for a React application. In this example, we're using the module react-router-dom to create a declarative routing system to allow navigations between pages. So we're using this component route with a path prop which is used to define the path and this prop as well which is used to render the component for the corresponding path. So this is how this is done for any React application. You need to define every route for every path that you need individually. So imagine that you just don't have a few pages but maybe 10, 20 or 30 pages even. This can be a lot of code and challenging to maintain. Also, you must not miss to create a route. Otherwise your navigation is broken. Instead for this challenge, I'd like you to create a file-based routing system. So you're going to need to create a page to display…

Contents