Static data storage
Answered
ABUL KALAM posted this in #help-forum

Where should i put static data like these dashboard links?
const linksCategories = [
{
title: "uploads",
name: "uploads",
},
{
title: "group chats",
name: "groupChats",
},
{
title: "members",
name: "members",
},
{
title: "teams & others",
name: "teamsAndOthers",
},
];
const linksData = {
uploads: [
{ text: "projects", href: "/admin/projects" },
{ text: "blogs", href: "/admin/blogs" },
{ text: "custom rates", href: "/admin/custom-rates" },
{ text: "product rates", href: "/admin/product-rates" },
],
groupChats: [
{ text: "client groups", href: "/admin/client-groups" },
{ text: "customer support", href: "/admin/customer-support" },
],
members: [
{ text: "clients", href: "/admin/clients" },
{ text: "users", href: "/admin/users" },
],
teamsAndOthers: [
{
text: "roles, analytics & cities",
href: "/admin/roles-analytics-cities",
},
{ text: "team, about us & banner", href: "/admin/team-aboutus-banner" },
],
};
Answered by B33fb0n3
next itself don't have an opinion about that. So you can put it whereever you want to. I prefer putting it next to my component in the specific route. Like that you can group your data and find everything on one view 👠@ABUL KALAM
7 Replies


next itself don't have an opinion about that. So you can put it whereever you want to. I prefer putting it next to my component in the specific route. Like that you can group your data and find everything on one view 👠@ABUL KALAM
Answer

please mark solution
if you use them in a React Server Component, they are rendered directly as HTML, the end user will never see the JSON
but anyway for a small subset of data like the links you show it's ok to send them client-side too, not a big deal