Closed lfgtavora closed 6 months ago
It seems you're encountering intermittent re-renders in your Next.js application when using components from the Shadcn library. To address this, consider ensuring proper memoization of your components using React.memo. Utilize React DevTools to inspect component hierarchies and dependencies for unexpected behavior. Check the Shadcn documentation and community discussions for any specific recommendations or known issues related to re-renders. Additionally, review your Next.js configuration, upgrade dependencies to the latest versions, and isolate the problem by creating a minimal test case. If the issue persists, consider alternatives to Shadcn for problematic components. This process should help identify and resolve the root cause of the unexpected re-renders.
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.
i using nextjs14 and suffering from recreations with components of shadcn, idn if i made something wrong but its bit weird.
i have a page: page.tsx (server component)
inside ActionMenu.tsx, i justing returning button from shadcn:
here the problems ocorrer: when i check browser log its intermitent, sometimes (very frequently) "test" (from ) is printing twice, but if i remove this shadcn Button component and use html default