Skip to content

Commit 3ffc797

Browse files
amirhhashemiLadyBluenoteskodiakhq[bot]
authored
Remove instructions about actions in useSubmission(s) reference (#1023)
Co-authored-by: Sarah <gerrardsarah@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent f2a0942 commit 3ffc797

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

src/routes/solid-router/reference/data-apis/use-submission.mdx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,11 @@ function Component() {
2424
}
2525
```
2626

27-
## Creating the action
27+
<Callout type="info">
2828

29-
The Action which will trigger the submission should be created with the [`action()`](/solid-router/reference/data-apis/action) helper and, when in a [SolidStart](/solid-start) app, it is recommended to leverage the `"use server"` directive to leverage the caching and RPC capabilities from the server-side.
29+
Learn more about actions in the [`action`](/solid-router/reference/data-apis/action) docs.
3030

31-
```tsx title="/component.tsx" {1,3-4}
32-
import { action } from "@solidjs/router";
33-
34-
const postNameAction = action(() => {
35-
"use server";
36-
/*... logic ...*/
37-
return { data: "Hello SolidStart" };
38-
})
39-
40-
```
31+
</Callout>
4132

4233
## Filtering Submissions
4334

src/routes/solid-router/reference/data-apis/use-submissions.mdx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,12 @@ function Component() {
4242
}
4343
```
4444

45-
## Creating the action
45+
<Callout type="info">
4646

47-
The Action which will trigger the submission should be created with the [`action()`](/solid-router/reference/data-apis/action) helper and, when in a [SolidStart](/solid-start) app. If in a [SolidStart](/solid-start) app to leverage the caching and RPC capabilities from the server-side.
47+
To trigger a submission, [actions](https://docs.solidjs.com/) can be used.
4848

49-
```tsx title="/component.tsx" {1,3-4}
50-
import { action } from "@solidjs/router";
5149

52-
const postNameAction = action(() => {
53-
"use server";
54-
/*... logic ...*/
55-
return { data: "Hello SolidStart" };
56-
})
57-
58-
```
50+
</Callout>
5951

6052
## Filtering Submissions
6153

@@ -202,4 +194,4 @@ function Component() {
202194
</form>
203195
)
204196
}
205-
```
197+
```

0 commit comments

Comments
 (0)