Skip to content

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

Merged
oliviertassinari merged 1 commit intomui:masterfrom
oliviertassinari:fix-use-autocomplete-use-client
Sep 17, 2024
Merged

[internal] useAutocomplete should have 'use client'#43778
oliviertassinari merged 1 commit intomui:masterfrom
oliviertassinari:fix-use-autocomplete-use-client

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 type: bug It doesn't behave as expected. internal Behind-the-scenes enhancement. Formerly called “core”. 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
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.

@oliviertassinari oliviertassinari changed the title [core] useAutocomplete should have 'use client' [internal] useAutocomplete should have 'use client' Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Behind-the-scenes enhancement. Formerly called “core”. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants