summaryrefslogtreecommitdiff
path: root/packages/integrations/react/src
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2024-11-25 03:43:15 -0500
committerGravatar GitHub <noreply@github.com> 2024-11-25 08:43:15 +0000
commit14feaf30e1a4266b8422865722a4478d39202404 (patch)
treeb76568bcd947fe90947de0a222ef85161186b1e3 /packages/integrations/react/src
parent30c78ba306bf063d9be7e13834f7e97978879aec (diff)
downloadastro-14feaf30e1a4266b8422865722a4478d39202404.tar.gz
astro-14feaf30e1a4266b8422865722a4478d39202404.tar.zst
astro-14feaf30e1a4266b8422865722a4478d39202404.zip
Rename Action query param to _action (#12510)
* rename _astroAction to _action * changeset
Diffstat (limited to 'packages/integrations/react/src')
-rw-r--r--packages/integrations/react/src/actions.ts6
1 files changed, 4 insertions, 2 deletions
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(