Skip to content

Commit efb8f2e

Browse files
Merge branch 'main' into docs/rendering-modes
2 parents b7a59ea + 529b062 commit efb8f2e

File tree

3 files changed

+71
-51
lines changed

3 files changed

+71
-51
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@tailwindcss/typography": "^0.5.19",
4747
"@types/node": "^25.0.3",
4848
"@typescript-eslint/eslint-plugin": "^8.46.4",
49-
"@typescript-eslint/parser": "^8.50.1",
49+
"@typescript-eslint/parser": "^8.51.0",
5050
"autoprefixer": "^10.4.23",
5151
"eslint": "^9.39.2",
5252
"eslint-plugin-solid": "^0.14.5",

pnpm-lock.yaml

Lines changed: 59 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/solid-start/reference/server/use-server.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,24 @@ description: >-
1717
Handle database operations, API calls, and secure logic on the server.
1818
---
1919

20-
`"use server"` will enable functions that only run on the server.
20+
`"use server"` enables functions or files to be executed only on the server. Server functions allow client components to call code that is executed in the server context.
2121

2222
```tsx
23+
// Function-level
2324
const logHello = async (message: string) => {
2425
"use server";
2526
console.log(message);
2627
};
2728
```
29+
Or when using at the top of a file.
30+
```tsx
31+
// File-level
32+
"use server";
33+
34+
const logHello = async (message: string) => {
35+
console.log(message);
36+
};
37+
```
2838

2939
**Note:** `"use server"` functions must be marked async or return a promise.
3040

0 commit comments

Comments
 (0)