_app layout component getting rendered in Plasmic Studio UI

Having a very strange issue with a Plasmic component being loaded into _app as a layout component. The component is being rendered in Plasmic studio UI :thinking_face:

image.png

import { PlasmicComponent, PlasmicRootProvider } from '@plasmicapp/loader-nextjs';
import { PLASMIC } from '../plasmic-init';
import '../styles/global.css';

function MyApp({ Component, pageProps }: any) {
return (
<PlasmicRootProvider loader={PLASMIC} >
<PlasmicComponent component="Header" />
<div>
<Component {...pageProps} />
</div>
<footer></footer>
</PlasmicRootProvider>
);
}

export default MyApp;

You’ll need to exempt rendering the layout component for the /plasmic-host page. You can do it a few different ways; I think this would work:

// plasmic-host.tsx
export default function PlasmicHost() {

}
PlasmicHost.isPlasmicHost = true;
// _app.ts
function MyApp({Component, pageProps}) {
  if (Component.isPlasmicHost) {
    return <Component {...pageProps} />;
  } else {
    // ...
   }
}

Thanks this works :tada: Is possible to target more specific?

Could we show the header component in Plasmic host, but only in the page views?

Hmm no not really… And we don’t really support having the host page render anything but PlasmicCanvasHost at the moment; weird things may happen :stuck_out_tongue:

haha well until you support plugins :wink: