Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix error0

Sara Vieira3719add6de8f
diff --git a/apps/designer/app/routes/designer/$id.tsx b/apps/designer/app/routes/designer/$id.tsx
index 8d1bc02b18..06bccecac0 100644
--- a/apps/designer/app/routes/designer/$id.tsx
+++ b/apps/designer/app/routes/designer/$id.tsx
@@ -1,4 +1,4 @@
-import { useLoaderData } from "@remix-run/react";
+import { useActionData, useLoaderData } from "@remix-run/react";
import { ActionFunction, LoaderFunction } from "@remix-run/node";
import type { Project, Asset } from "@webstudio-is/react-sdk";
import { Designer, links } from "~/designer";
@@ -53,10 +53,14 @@ export const action: ActionFunction = async ({ request, params }) => {
};
const DesignerRoute = () => {
+ const actionData = useActionData();
const data = useLoaderData<Data | Error>();
if ("errors" in data) {
return <p>{data.errors}</p>;
}
+ if (actionData && "errors" in actionData) {
+ return <p>{actionData.errors}</p>;
+ }
return <Designer {...data} />;
};