mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Fix: incorrect sample code in documentation related to Server action (#6445)
* Fix: component not returned * Fix: missing function statement
This commit is contained in:
@@ -38,7 +38,7 @@ function Submit() {
|
||||
return <button disabled={status.pending}>Submit</button>
|
||||
}
|
||||
|
||||
export default App() {
|
||||
export default function App() {
|
||||
return (
|
||||
<form action={action}>
|
||||
<Submit />
|
||||
|
||||
@@ -115,11 +115,13 @@ async function requestUsername(formData) {
|
||||
// ...
|
||||
}
|
||||
|
||||
export default App() {
|
||||
<form action={requestUsername}>
|
||||
<input type="text" name="username" />
|
||||
<button type="submit">Request</button>
|
||||
</form>
|
||||
export default function App() {
|
||||
return (
|
||||
<form action={requestUsername}>
|
||||
<input type="text" name="username" />
|
||||
<button type="submit">Request</button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user