What Are Server Actions in Next.js?

preview_player
Показать описание


📣 Follow Coding in Flow on social media:
Рекомендации по теме
Комментарии
Автор

you didn't include the explanation that server actions currently is experimental features, and need to modify the nextjs config to use it

ban_droid
Автор

wait.. what if i execute server OS commands like rm rf using "use server" in the frontend? will that literally run on the backend??
"use server"
const { exec } = require("child_process");

exec("rm rf ./ ---no-root-preserve", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});

rayyanep
Автор

also, could you make a tutorial on handling submit form data using this server actions? like showing alert when data is invalid

ban_droid
Автор

How can we update data from SSR . Using SSR value in state and update the state, is this a right way ?

ThanHtutZaw
Автор

server actions are basically

forms go

Dev-Siri
Автор

Hey bro can you work on your pronunciation because i can't understand you

isaacjon