summaryrefslogtreecommitdiff
path: root/packages/integrations/react
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/react')
-rw-r--r--packages/integrations/react/package.json4
-rw-r--r--packages/integrations/react/server.js6
-rw-r--r--packages/integrations/react/src/actions.ts6
3 files changed, 7 insertions, 9 deletions
diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json
index 3c899620c..1ce3c5032 100644
--- a/packages/integrations/react/package.json
+++ b/packages/integrations/react/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/react",
"description": "Use React components within Astro",
- "version": "3.6.3",
+ "version": "3.6.3-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -51,7 +51,7 @@
"dependencies": {
"@vitejs/plugin-react": "^4.3.3",
"ultrahtml": "^1.5.3",
- "vite": "^5.4.10"
+ "vite": "6.0.0-beta.6"
},
"devDependencies": {
"@types/react": "^18.3.12",
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(