Unverified Commit 873bd82f authored by Mustafa Çor's avatar Mustafa Çor Committed by GitHub

docs: Server Action example (#59159)

parent eab1fe83
......@@ -43,6 +43,17 @@ export default async function submit() {
}
```
```js filename="app/actions.js" switcher
'use server'
import { revalidateTag } from 'next/cache'
export default async function submit() {
await addPost()
revalidateTag('posts')
}
```
### Route Handler
```ts filename="app/api/revalidate/route.ts" switcher
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment