Skip to content
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

[core] useAutocomplete should have 'use client' #43778

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Sep 15, 2024

Fix #41956 (comment).

If from a server component, we import a hook, then different behaviors can happen:

  • Next.js v15.0.0-rc.0
    • hook with "use client" 🔴 (seems to be a recent regression) SCR-20240915-czvu
    • hook without "use client" 🟡 SCR-20240915-daas
  • Next.js (turbo pack) v15.0.0-rc.0
    • hook with "use client" 🟢 SCR-20240915-czqh
    • hook without "use client" 🟡 SCR-20240915-cnjt
  • Waku v0.21.2
    • hook with "use client" 🟢 SCR-20240915-datp
    • hook without "use client" 🔴 SCR-20240915-dawq

Based on the different cases 🔴/🟡/🟢, it looks like we should have "use client" for hooks too. It yields the best DX.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work core Infrastructure work going on behind the scenes labels Sep 15, 2024
@mui-bot
Copy link

mui-bot commented Sep 15, 2024

Netlify deploy preview

https://deploy-preview-43778--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against bf52267

@oliviertassinari oliviertassinari changed the title [core] useAutocomplete should have 'use client [core] useAutocomplete should have 'use client' Sep 15, 2024
Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @oliviertassinari

Next.js v15.0.0-rc.0: hook with "use client" 🔴 (seems to be a recent regression)

Are they fixing this? Is there an issue reported?

@oliviertassinari oliviertassinari merged commit e1967f8 into mui:master Sep 17, 2024
21 checks passed
@oliviertassinari oliviertassinari deleted the fix-use-autocomplete-use-client branch September 17, 2024 13:02
@oliviertassinari
Copy link
Member Author

oliviertassinari commented Sep 17, 2024

@DiegoAndai I can't find anything related to it. The closest that I can find: vercel/next.js#69159.

👍 to open a new issue. I won't have the time for it, but feel free to, e.g. Jan opened a few https://github.com/vercel/next.js/issues/created_by/janpot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants