is there a way to use it without rerendering the whole page? you can see that the whole component tree re-rendered, even thought the only thing that changed was the list.
Man, I don't know what I'm doing wrong, but I get to 5:47, and I'm getting "Error: fetch failed". I can click on the link to the JSON endpoint on 3001, and it shows up just fine, but I can't get the other project to perform the fetch. Is it some kind of CORS setting or something? I'll try a few more things.
Why do we use server actions here in order to make a call to an api. We can do this by calling fetch on the client. I thought that benefits of using server actions not ot use an api call but having a direact access to the db in the server action.
Good question! There are bunch of other benefits too on top of the direct db access for example the api call most likely is faster from the server, the client side bundle is smaller because it doesnt have to include the fetching logic, seo benefits, initial page load and fcp are faster, caching.
@@TuomoKankaanpaa Also not all API calls are the same. For example, you might want to access an external api using the apps keys as authentication, while not exposing them to the client.
is there a way to use it without rerendering the whole page? you can see that the whole component tree re-rendered, even thought the only thing that changed was the list.
If I dont add "use server", will it save it to browser cache?
thank you for your work❤
Cheers!
Man, I don't know what I'm doing wrong, but I get to 5:47, and I'm getting "Error: fetch failed". I can click on the link to the JSON endpoint on 3001, and it shows up just fine, but I can't get the other project to perform the fetch. Is it some kind of CORS setting or something? I'll try a few more things.
Why do we use server actions here in order to make a call to an api. We can do this by calling fetch on the client. I thought that benefits of using server actions not ot use an api call but having a direact access to the db in the server action.
Good question! There are bunch of other benefits too on top of the direct db access for example the api call most likely is faster from the server, the client side bundle is smaller because it doesnt have to include the fetching logic, seo benefits, initial page load and fcp are faster, caching.
@@TuomoKankaanpaa Also not all API calls are the same. For example, you might want to access an external api using the apps keys as authentication, while not exposing them to the client.
what theme are you using in vscode?
Aura dark
Kuulostat yhdeltä mun it opettajalta jonka nimi on Timo :) hänelläkin sama sukunimi
Aijaa sehän sattui sopivasti 😄👍
wtf with background music at start 🤣🤣
maybe a bit too epic 😅
Yeah I can't get past that. I'm about to click the browser back button. Bye.
57 seconds ago.. ❤
Nice!🤩