summaryrefslogtreecommitdiff
path: root/packages/integrations/react
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/react')
-rw-r--r--packages/integrations/react/server.js6
-rw-r--r--packages/integrations/react/src/actions.ts6
2 files changed, 5 insertions, 7 deletions
diff --git a/packages/integrations/react/server.js b/packages/integrations/react/server.js
index 69b0a8e12..9c3c309cc 100644
--- a/packages/integrations/react/server.js
+++ b/packages/integrations/react/server.js
@@ -126,11 +126,7 @@ async function getFormState({ result }) {
* This matches the endpoint path.
* @example "/_actions/blog.like"
*/
- const actionName =
- searchParams.get('_astroAction') ??
- /* Legacy. TODO: remove for stable */ formData
- .get('_astroAction')
- ?.toString();
+ const actionName = searchParams.get('_action');
if (!actionKey || !actionName) return undefined;
diff --git a/packages/integrations/react/src/actions.ts b/packages/integrations/react/src/actions.ts
index a5ccb2f9a..06ecd4148 100644
--- a/packages/integrations/react/src/actions.ts
+++ b/packages/integrations/react/src/actions.ts
@@ -26,7 +26,7 @@ export function experimental_withState<T>(action: FormFn<T>) {
// Called by React when form state is passed from the server.
// If the action names match, React returns this state from `useActionState()`.
callback.$$IS_SIGNATURE_EQUAL = (incomingActionName: string) => {
- const actionName = new URLSearchParams(action.toString()).get('_astroAction');
+ const actionName = new URLSearchParams(action.toString()).get('_action');
return actionName === incomingActionName;
};
@@ -46,7 +46,9 @@ export function experimental_withState<T>(action: FormFn<T>) {
*/
export async function experimental_getActionState<T>({
request,
-}: { request: Request }): Promise<T> {
+}: {
+ request: Request;
+}): Promise<T> {
const contentType = request.headers.get('Content-Type');
if (!contentType || !isFormRequest(contentType)) {
throw new AstroError(