@@ -138,6 +138,8 @@ You can invoke Server Actions using the following methods:
...
@@ -138,6 +138,8 @@ You can invoke Server Actions using the following methods:
You can use React's`action`proptoinvokeaServerActionona`form`element.ServerActionspassedwiththeactionpropactasasynchronoussideeffectsinresponsetouserinteraction.
You can use React's`action`proptoinvokeaServerActionona`form`element.ServerActionspassedwiththeactionpropactasasynchronoussideeffectsinresponsetouserinteraction.
```jsx filename="app/add-to-cart.js"
```jsx filename="app/add-to-cart.js"
import { cookies } from 'next/headers'
export default function AddToCart({ productId }) {
export default function AddToCart({ productId }) {