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 Image blink on link click (#1189)

Ivan Starkov2f6c3bb9cb39
diff --git a/apps/builder/app/routes/$.tsx b/apps/builder/app/routes/$.tsx
index f2a33dc344..fd0dc21401 100644
--- a/apps/builder/app/routes/$.tsx
+++ b/apps/builder/app/routes/$.tsx
@@ -109,20 +109,23 @@ export const ErrorBoundary: ErrorBoundaryComponent = ({ error }) => {
return <ErrorMessage message={message} />;
};
-const Content = () => {
+const Outlet = () => {
const data = useLoaderData<Data>();
- const Outlet =
- data.mode === "edit"
- ? () => <Canvas data={data} getComponent={getComponent} />
- : () => (
- <InstanceRoot
- data={data}
- getComponent={getComponent}
- customComponents={customComponents}
- />
- );
+ if (data.mode === "edit") {
+ return <Canvas data={data} getComponent={getComponent} />;
+ }
+
+ return (
+ <InstanceRoot
+ data={data}
+ getComponent={getComponent}
+ customComponents={customComponents}
+ />
+ );
+};
+const Content = () => {
// @todo This is non-standard for Remix, is there a better way?
// Maybe there is a way to tell remix to use the right outlet somehow and avoid passing it?
return <Root Outlet={Outlet} />;