Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark dynamic as client component (#38574)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d403218
commit 6b578f0
Showing
10 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
test/e2e/app-dir/app/app/dashboard/index/dynamic.client.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { useState } from 'react' | ||
import styles from './dynamic.module.css' | ||
|
||
export default function Dynamic() { | ||
let [state] = useState('next dynamic') | ||
return ( | ||
<p id="css-text-dynamic" className={styles.dynamic}> | ||
hello from modern the {state} | ||
</p> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dynamic { | ||
color: blue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import styles from './lazy.module.css' | ||
|
||
export default function LazyComponent() { | ||
return ( | ||
<> | ||
<p>hello from lazy</p> | ||
<p id="css-text-lazy" className={styles.lazy}> | ||
hello from lazy | ||
</p> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.lazy { | ||
color: purple; | ||
} |
7 changes: 7 additions & 0 deletions
7
test/e2e/app-dir/app/app/dashboard/index/next-dynamic.client.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import dynamic from 'next/dynamic' | ||
|
||
const Dynamic = dynamic(() => import('./dynamic.client')) | ||
|
||
export function NextDynamicClientComponent() { | ||
return <Dynamic /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { ClientComponent } from './test.client.js' | ||
import { LazyClientComponent } from './react-lazy.client' | ||
import { NextDynamicClientComponent } from './next-dynamic.client' | ||
|
||
export default function DashboardIndexPage() { | ||
return ( | ||
<> | ||
<p>hello from app/dashboard/index</p> | ||
<ClientComponent /> | ||
<NextDynamicClientComponent /> | ||
<LazyClientComponent /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters