Next.js Discord

Discord Forum

nextjs 14 app , how can i revalidate layout.tsx file

Unanswered
Asari posted this in #help-forum
Open in Discord
AsariOP
in layout.tsx file
 return (
    <div >

           <NavBar/>
           {children}
           <Footer/>
    </div>
  );



in NavBar component i get data with nextjs ServerActions,
i want to revalidate NavBar component with on-demand revalidation not like
export const revalidate = 3600 // invalidate every hour

also only the navbar component should revalidate. not the all pages like "revalidatePath(/,"layout")"

0 Replies