-
Notifications
You must be signed in to change notification settings - Fork 47.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into component-stack-fix
- Loading branch information
Showing
237 changed files
with
12,467 additions
and
6,687 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
|
||
let LazyDynamic = React.lazy(() => | ||
import('./Dynamic.js').then(exp => ({default: exp.Dynamic})) | ||
); | ||
|
||
export function Client() { | ||
const [loaded, load] = React.useReducer(() => true, false); | ||
|
||
return loaded ? ( | ||
<div> | ||
loaded dynamically: <LazyDynamic /> | ||
</div> | ||
) : ( | ||
<div> | ||
<button onClick={load}>Load dynamic import Component</button> | ||
</div> | ||
); | ||
} |
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,14 +1,17 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import {experimental_useFormState as useFormState} from 'react-dom'; | ||
|
||
import Container from './Container.js'; | ||
|
||
export function Counter() { | ||
const [count, setCount] = React.useState(0); | ||
export function Counter({incrementAction}) { | ||
const [count, incrementFormAction] = useFormState(incrementAction, 0); | ||
return ( | ||
<Container> | ||
<button onClick={() => setCount(c => c + 1)}>Count: {count}</button> | ||
<form> | ||
<button formAction={incrementFormAction}>Count: {count}</button> | ||
</form> | ||
</Container> | ||
); | ||
} |
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,12 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
|
||
export function Dynamic() { | ||
return ( | ||
<div> | ||
This client component should be loaded in a single chunk even when it is | ||
used as both a client reference and as a dynamic import. | ||
</div> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use client'; | ||
|
||
var React = require('react'); | ||
|
||
function Note() { | ||
return 'This component was exported on a commonJS module and imported into ESM as a named import.'; | ||
} | ||
|
||
module.exports = { | ||
Note, | ||
}; |
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
Oops, something went wrong.