Next.js Discord

Discord Forum

Question related to server actions.

Unanswered
Huntaway posted this in #help-forum
Open in Discord
HuntawayOP
hello there, can we use both client and server actions??
"use client"

export default function Data() {
  async function saveData(data) {
    "use server";
     //api request
  }

return (
 <>
  <button onClick{() => saveData(data)}>Click me</button>
 </>
  );
}

0 Replies