Skip to content

Commit

Permalink
(Docs) add missing import. (#52992)
Browse files Browse the repository at this point in the history
`import { cookies } from 'next/headers'`
  • Loading branch information
vinaykulk621 committed Jul 22, 2023
1 parent 83d0f1e commit 94878fe
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ You can invoke Server Actions using the following methods:
You can use React's `action` prop to invoke a Server Action on a `form` element. Server Actions passed with the action prop act as asynchronous side effects in response to user interaction.
```jsx filename="app/add-to-cart.js"
import { cookies } from 'next/headers'

export default function AddToCart({ productId }) {
async function addItem(data) {
'use server'
Expand Down

0 comments on commit 94878fe

Please sign in to comment.