Skip to content

Commit

Permalink
Remove instructions about actions in useSubmission(s) reference
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhhashemi committed Jan 15, 2025
1 parent 4e1d35a commit b21eae5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
15 changes: 3 additions & 12 deletions src/routes/solid-router/reference/data-apis/use-submission.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,11 @@ function Component() {
}
```

## Creating the action
<Callout type="info" title="Note">

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.
You can [learn more about actions here](/solid-router/reference/data-apis/action).

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

const postNameAction = action(() => {
"use server";
/*... logic ...*/
return { data: "Hello SolidStart" };
})

```
</Callout>

## Filtering Submissions

Expand Down
17 changes: 4 additions & 13 deletions src/routes/solid-router/reference/data-apis/use-submissions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,11 @@ function Component() {
}
```

## Creating the action
<Callout type="info" title="Note">

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.
You can [learn more about actions here](/solid-router/reference/data-apis/action).

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

const postNameAction = action(() => {
"use server";
/*... logic ...*/
return { data: "Hello SolidStart" };
})

```
</Callout>

## Filtering Submissions

Expand Down Expand Up @@ -202,4 +193,4 @@ function Component() {
</form>
)
}
```
```

0 comments on commit b21eae5

Please sign in to comment.