Unverified Commit 94878fe7 authored by vinay's avatar vinay Committed by GitHub

(Docs) add missing import. (#52992)


`import { cookies } from 'next/headers'`
parent 83d0f1e9
......@@ -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'
......
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