Make Client Component Explicit Instead Of Implicit In Next.js
Topic | Source |
---|---|
React | All 29 Next.js Mistakes Beginners Make - YouTube |
A component can be a client component, even if "use client"
is not explicitly written at the top of it, when it is imported and used inside another client component (e.g. a button used inside some navigation bar, where the bar is a client component). However, it is best not to rely on this and make the button explicitly a client component if it needs client-side logic. This makes the code more maintainable and easier to understand