Skip to content

Commit

Permalink
docs: fix typos in 08-mutating-data.mdx (#74856)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamBalaya56562 authored Jan 14, 2025
1 parent 6cc85de commit 23dee53
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/01-app/01-getting-started/08-mutating-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function deletePost(formData) {}
Server Functions can be inlined in Server Components by adding the `"use server"` directive to the top of the function body:

```tsx filename="app/page.tsx" switcher
export async default function Page() {
export default function Page() {
// Server Action
async function createPost() {
'use server'
Expand Down Expand Up @@ -66,7 +66,7 @@ export default function Page() {
It's not possible to define Server Functions in Client Components. However, you can invoke them in Client Components by importing them from a file that has the `"use server"` directive at the top of it:
```tsx filename="app/actions.ts" switcher
```ts filename="app/actions.ts" switcher
'use server'

export async function createPost() {}
Expand Down Expand Up @@ -139,7 +139,7 @@ export function Form() {
}
```
```tsx filename="app/actions.ts" switcher
```ts filename="app/actions.ts" switcher
'use server'

export async function createPost(formData: FormData) {
Expand All @@ -151,7 +151,7 @@ export async function createPost(formData: FormData) {
}
```
```jsx filename="app/actions.js" switcher
```js filename="app/actions.js" switcher
'use server'

export async function createPost(formData) {
Expand Down Expand Up @@ -189,6 +189,9 @@ export default function LikeButton({ initialLikes }: { initialLikes: number }) {
>
Like
</button>
</>
)
}
```
```jsx filename="app/like-button.js" switcher
Expand Down

0 comments on commit 23dee53

Please sign in to comment.