rsnext/test/e2e/app-dir/dynamic
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
..
app Fix next dynamic import named export from client components (#61378) 2024-01-31 14:50:20 +01:00
pages/legacy Separate next/dynamic implementation for app and pages (#45565) 2023-02-04 01:45:35 +00:00
ui Fix dynamic no ssr with babel transform (#45091) 2023-01-23 13:39:47 -08:00
dynamic.test.ts Fix next dynamic import named export from client components (#61378) 2024-01-31 14:50:20 +01:00
next.config.js Remove experimental config from create-next-app (#49241) 2023-05-05 00:22:28 -07:00