mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
When using `next/dynamic` in server components to load a client component with named export, we shouldn't dot into the prop name since client component reference as it's already a valid react component type. It would work with `default` prop but not other named exports. Let's say `mod` is a dynamic imported module ``` mod.Button.default ``` will become the client reference key ``` mod#Button#default ``` Which means in module `mod`, get `Button` export, then `default` property of it, which is wrong but it's a valid key in the client reference roxy. This PR checks if they're client module, then return itself as dynamic imported component type for `next/dynamic` if it is one. Fixes #61046 Closes NEXT-2229