From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

RQ: Project structure

Let's discuss about few questions. So how will you change the web app's title? Changing the title or even the metadata can be done from the layout.js file in the app directory. The second question, if I want to create a route slash details, then how can I do it? As discussed, to create a details route, you have to create a folder named details in the app directory. We will see the detailed process of route creation in the coming lectures. Can I use a .tsx file for the page component? Well, certainly you can .ts or .tsx file if you have opted for TypeScript while configuring the project. In the current app, we have selected JavaScript, so we can use the .js or .jsx convention. And the last one, how will you render an h1 with custom text on the main page. So as we have seen to render custom text, we'll go to the page.js where we have the home component. And here I will clear this image and simply use the H1 tag and the text My First Application. Let's save this and check the output. And there we have the text rendered.

Contents