NextJS APIs vs Server Actions

  Рет қаралды 2,607

Ras Mic

Ras Mic

Күн бұрын

In this video, I cover a simple example of how to use Server Actions instead of Next.js APIs, along with sharing my personal opinions on them.
Follow me on Twitter: / rasmickyy
Join my Discord: / discord
Sponsor a video: www.passionfro...

Пікірлер: 14
@vjzb3
@vjzb3 6 ай бұрын
Solid video, thanks man! I’m new to Next.js so this was super helpful. Subscribed!
@rasmic
@rasmic 6 ай бұрын
Thanks for subscribing. Means a lot!
@ankitrai96
@ankitrai96 6 ай бұрын
Welcome to coding 101 by The Weekend.
@rasmic
@rasmic 6 ай бұрын
😂
@vinaciotm
@vinaciotm Ай бұрын
keep making videos about next. Thanks 🇧🇷
@rasmic
@rasmic Ай бұрын
More to come!
@exodia_hosni
@exodia_hosni Ай бұрын
i know it's a stupid question but what's a webhook api what's the difference between webhook and normal apis like rest api i don't really get it
@rasmic
@rasmic 28 күн бұрын
I'd watch videos on it so u can full understand my g
@ShiNoBiize
@ShiNoBiize 5 ай бұрын
Hey Ras, I would like to know how you use server actions with a regular button (not in form) which fire a get/post function onClick :) for example you have an invitation page with a token and you can accept or decile the invitation, so you have 2 buttons "accept" and "deny" and these bottuns execute a server action function which writes to the DB the decision.
@rasmic
@rasmic 5 ай бұрын
Here's a piece of code, the deleteBeacon function is a server action onClick={async (e) => { e.preventDefault() try { const response = await deleteBeacon(info?.id) queryClient.invalidateQueries({ queryKey: ['get-beacons', user?.id!] }) toast("Beacon deleted") router.refresh() return response } catch (error) { console.log('error') Sentry.captureException(error); toast("Deleting failed") return }
@jayantaggarwal4397
@jayantaggarwal4397 2 ай бұрын
is it feasible from deployment point of view to use server actions instead of api routes ? will it result in some sort of problems or not?
@rasmic
@rasmic 2 ай бұрын
there are some cons, will talk about in a video
@govindpvenu
@govindpvenu 25 күн бұрын
i think we are not supposed to fetch data using server actions.Right?
@rasmic
@rasmic 25 күн бұрын
we not!! check my updated videos
3 Years Experienced React Interview
1:16:16
ProCodrr
Рет қаралды 36 М.
NextJS Tutorial - All 12 Concepts You Need to Know
44:38
ByteGrad
Рет қаралды 306 М.
大家都拉出了什么#小丑 #shorts
00:35
好人小丑
Рет қаралды 92 МЛН
Фейковый воришка 😂
00:51
КАРЕНА МАКАРЕНА
Рет қаралды 7 МЛН
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 37 МЛН
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 60 МЛН
React + Servers = Confusion
20:30
Theo - t3․gg
Рет қаралды 42 М.
The Problem with React Server Actions
9:45
Josh tried coding
Рет қаралды 19 М.
When to use server actions in Next JS 14
5:28
WebDevEducation
Рет қаралды 9 М.
How To Use Next.js 14 Server Actions
21:06
Brett Westwood - Software Engineer
Рет қаралды 25 М.
How To PROPERLY Fetch Data In Nextjs 14 | Lee Rob Explains
13:03
How I structure my next.js applications
23:19
Web Dev Cody
Рет қаралды 28 М.
大家都拉出了什么#小丑 #shorts
00:35
好人小丑
Рет қаралды 92 МЛН