diff --git a/app/marko/src/client/preview/render.js b/app/marko/src/client/preview/render.js
index <HASH>..<HASH> 100644
--- a/app/marko/src/client/preview/render.js
+++ b/app/marko/src/client/preview/render.js
@@ -23,6 +23,6 @@ export default function renderMain({ story, selectedKind, selectedStory, showMai
     return;
   }
 
-  currLoadedComponent = element.appendTo(rootEl).getComponent();
   showMain();
+  currLoadedComponent = element.appendTo(rootEl).getComponent();
 }
Fix render order in preview for marko