Routing

Routing

Hybrix Nextjs is having file base routing setup. When you create a file in the "pages" directory, it becomes a route that can be accessed through the URL.

For example, if you create a file called "about.tsx" in the "pages" directory, it can be accessed through the URL "http://localhost:3000/about".

Here's an example of how you can create a simple routing system using Next.js:

How to add new route ?

You can easily add, change or remove any route by simply making changes described below:

1. You will find "pages" directory, create file called "about.tsx" in it.
2. In the "about.tsx" file, add the following code:

const About = () => {
  return (
    
Welcome to my Next.js app!
) } export default About;

3. Go to "http://localhost:3000/about" to see the about page.
4. You can create as many pages as you want using this method.

Note : you don't need to restart the development server in order to see the menu changes getting in effect
© Hybrix.
Design & Develop by Themesbrand