Skip to content

Commit

Permalink
Fix: incorrect sample code in documentation related to Server action …
Browse files Browse the repository at this point in the history
…(#6445)

* Fix: component not returned

* Fix: missing function statement
  • Loading branch information
nonoakij authored Nov 21, 2023
1 parent 4f9e9a5 commit aa0c547
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/hooks/useFormStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 />
Expand Down
12 changes: 7 additions & 5 deletions src/content/reference/react/use-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
}
```

Expand Down

0 comments on commit aa0c547

Please sign in to comment.