aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
16.4k stars 578 forks source link

NextJS client component issue (shadcn/ui) #1123

Open ChrisBoik opened 2 months ago

ChrisBoik commented 2 months ago

What version of million are you using?

^1.0.0-rc.84

Are you using an SSR adapter? If so, which one?

n/a local

What package manager are you using?

npm

What operating system are you using?

Windows

What browser are you using?

Chrome

Describe the Bug

When using Million in NextJS with shadcn/ui, interactive use-client components (directly from shadcn/ui - Dark Mode Toggle) the interactive dropdown does not render on click toggle.

When I manually forced the dropdown to 'show' via props, although it does not visually appear, the dom now shows the dropdown elements but are translated off-screen.

Initially thought a shadcn/ui bug but turns out disabling Million solved this problem. A user on Twitter seems to have experienced the same issue: Twitter user's post

The button appears to basically lose all interactivity, the underlying shadcn/ui primitives do not even react to the click event as far as I can tell.

What's the expected result?

My use-client components do not get affected by million's profiling/wrapper components (assumed).

Link to Minimal Reproducible Example

Coming soon

Participation

github-actions[bot] commented 2 months ago

Thanks for opening this issue! A maintainer will review it soon.

aidenybai commented 1 month ago

Hi @ChrisBoik , we've just deployed a fix for you. Can you try running the setup script npx million@latest. Once it's done, please restart your VSCode/Cursor. Let me know if that works for you!