diff options
Diffstat (limited to 'packages/integrations/react/src/actions.ts')
-rw-r--r-- | packages/integrations/react/src/actions.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/integrations/react/src/actions.ts b/packages/integrations/react/src/actions.ts index 336d32220..bc45e28ee 100644 --- a/packages/integrations/react/src/actions.ts +++ b/packages/integrations/react/src/actions.ts @@ -25,8 +25,9 @@ export function experimental_withState<T>(action: FormFn<T>) { callback.$$FORM_ACTION = action.$$FORM_ACTION; // 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 = (actionName: string) => { - return action.toString() === actionName; + callback.$$IS_SIGNATURE_EQUAL = (incomingActionName: string) => { + const actionName = new URLSearchParams(action.toString()).get('_astroAction'); + return actionName === incomingActionName; }; // React calls `.bind()` internally to pass the initial state value. |