Next.js Discord

Discord Forum

Routing through different tabs from a server-side component

Answered
Austrian Pinscher posted this in #help-forum
Open in Discord
Austrian PinscherOP
Hello guys, I'm new to Next14, I have an application and I have an object with a lot of information that I would fetch from the backend in a server component, I want to create a page that is read only of that data, but I need to go through different tabs, how do you think I should handle the routing for this tab management?
So far I thought about having different routes for each tab and change through them when I click on a tab, but I think there should be some better ways.
Answered by B33fb0n3
a good and efficient way would be to have your page.tsx load the huge object and pass it to a client component that handles the instant switching of the tabs to view the data.

You don't want to refetch the huge object again and again just because of a navigation.

So do it like a mentioned and you will like it ^^
View full answer

3 Replies