Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Invoices Page | Advanced Features
course content

Зміст курсу

Next.js 14

Invoices PageInvoices Page

Congratulations! We've covered all the fundamental Next.js concepts. You're now equipped to build various types of apps using Next.js.

Moving forward, we'll delve into advanced concepts that are optional for some apps or projects. However, gaining knowledge of these concepts can be highly beneficial.

Back to the Project

Let's shift our focus to the Invoices page and proceed with its development.

Please copy and paste the following code into app/dashboard/invoices/page.tsx. Take some time to inspect and understand the purpose of this code.

app/dashboard/invoices/page.tsx

The application has three key features:

  • Search lets users look for specific invoices;
  • Pagination allows them to navigate between pages of invoices;
  • Table shows all the invoices available.
The search functionality works on both the client and the server. When a user searches for an invoice on the client, the URL parameters are updated, and data is fetched from the server. Finally, the table is re-rendered on the server side with the updated data.

We will use URL search parameters to handle the search state, which might be new if you're accustomed to using a client-side state.

Benefits include:

  • Users can bookmark or share the current application state, including search queries and filters, as the parameters are part of the URL;
  • URL parameters facilitate server-side rendering, directly simplifying the initial state setup on the server;
  • With search details in the URL, tracking user behavior becomes easier, requiring less client-side logic.

Let's proceed with this idea in the upcoming chapter.

In Practice

Все було зрозуміло?

Секція 6. Розділ 1
course content

Зміст курсу

Next.js 14

Invoices PageInvoices Page

Congratulations! We've covered all the fundamental Next.js concepts. You're now equipped to build various types of apps using Next.js.

Moving forward, we'll delve into advanced concepts that are optional for some apps or projects. However, gaining knowledge of these concepts can be highly beneficial.

Back to the Project

Let's shift our focus to the Invoices page and proceed with its development.

Please copy and paste the following code into app/dashboard/invoices/page.tsx. Take some time to inspect and understand the purpose of this code.

app/dashboard/invoices/page.tsx

The application has three key features:

  • Search lets users look for specific invoices;
  • Pagination allows them to navigate between pages of invoices;
  • Table shows all the invoices available.
The search functionality works on both the client and the server. When a user searches for an invoice on the client, the URL parameters are updated, and data is fetched from the server. Finally, the table is re-rendered on the server side with the updated data.

We will use URL search parameters to handle the search state, which might be new if you're accustomed to using a client-side state.

Benefits include:

  • Users can bookmark or share the current application state, including search queries and filters, as the parameters are part of the URL;
  • URL parameters facilitate server-side rendering, directly simplifying the initial state setup on the server;
  • With search details in the URL, tracking user behavior becomes easier, requiring less client-side logic.

Let's proceed with this idea in the upcoming chapter.

In Practice

Все було зрозуміло?

Секція 6. Розділ 1
some-alt