Skip to content

don't recommend making layout.js "use client" for app router installation in nextjs #1953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anngbaum
Copy link

@anngbaum anngbaum commented Jul 17, 2025

This is pretty wrong – it's not recommended in nextjs to "use client" for the root layout. Would save people some time not to recommend this pattern and to use a Provider wrapper instead.

This is pretty wrong – it's not recommended in nextjs to "use client" for the root layout. Would save people some time not to recommend this pattern and to use a Provider wrapper instead.

In testing, I also found that autotrack doesn't work as expected with app router. We added some additional logic to usePathname and just implement that inside the provider, which I left out for simplicity here but is probably worth flagging as well.
@anngbaum anngbaum requested a review from a team as a code owner July 17, 2025 15:04
@anngbaum anngbaum requested review from pmackle and removed request for a team July 17, 2025 15:04
Copy link

vercel bot commented Jul 17, 2025

@anngbaum is attempting to deploy a commit to the Mixpanel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant