rsnext/test/e2e/app-dir/dynamic/app
Jiachi Liu fd6db76ae0
Fix next dynamic import named export from client components (#61378)
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
2024-01-31 14:50:20 +01:00
..
chunk-loading Remove client only dynamic chunks from edge bundle (#56761) 2023-11-16 15:10:28 +00:00
dynamic Fix next dynamic import named export from client components (#61378) 2024-01-31 14:50:20 +01:00
dynamic-mixed-ssr-false Remove client only dynamic chunks from edge bundle (#56761) 2023-11-16 15:10:28 +00:00
layout.js Separate next/dynamic implementation for app and pages (#45565) 2023-02-04 01:45:35 +00:00