You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**BREAKING CHANGE to the experimental Actions API only.** Install the latest `@astrojs/react` integration as well if you're using React 19 features.
7
+
8
+
Updates the Astro Actions fallback to support `action={actions.name}` instead of using `getActionProps().` This will submit a form to the server in zero-JS scenarios using a search parameter:
9
+
10
+
```astro
11
+
---
12
+
import { actions } from 'astro:actions';
13
+
---
14
+
15
+
<form action={actions.logOut}>
16
+
<!--output: action="?_astroAction=logOut"-->
17
+
<button>Log Out</button>
18
+
</form>
19
+
```
20
+
21
+
You may also construct form action URLs using string concatenation, or by using the `URL()` constructor, with the an action's `.queryString` property:
22
+
23
+
```astro
24
+
---
25
+
import { actions } from 'astro:actions';
26
+
27
+
const confirmationUrl = new URL('/confirmation', Astro.url);
`getActionProps()` is now deprecated. To use the new fallback pattern, remove the `getActionProps()` input from your form and pass your action function to the form `action` attribute:
* Action was called from a form using a GET request, but only POST requests are supported. This often occurs if `method="POST"` is missing on the form.
1626
+
*/
1627
+
exportconstActionsUsedWithForGetError={
1628
+
name: 'ActionsUsedWithForGetError',
1629
+
title: 'An invalid Action query string was passed by a form.',
1630
+
message: (actionName: string)=>
1631
+
`Action ${actionName} was called from a form using a GET request, but only POST requests are supported. This often occurs if \`method="POST"\` is missing on the form.`,
1632
+
hint: 'Actions are experimental. Visit the RFC for usage instructions: https://github.com/withastro/roadmap/blob/actions/proposals/0046-actions.md',
* The server received the query string `?_astroAction=name`, but could not find an action with that name. Use the action function's `.queryString` property to retrieve the form `action` URL.
1641
+
*/
1642
+
exportconstActionQueryStringInvalidError={
1643
+
name: 'ActionQueryStringInvalidError',
1644
+
title: 'An invalid Action query string was passed by a form.',
1645
+
message: (actionName: string)=>
1646
+
`The server received the query string \`?_astroAction=${actionName}\`, but could not find an action with that name. If you changed an action's name in development, remove this query param from your URL and refresh.`,
1647
+
hint: 'Actions are experimental. Visit the RFC for usage instructions: https://github.com/withastro/roadmap/blob/actions/proposals/0046-actions.md',
0 commit comments