Is it possible in plasmic-host.tsx
to receive the path of the component being previewed? i’m needing to fetch some extra data in there for a page
From a code component, you can do usePlasmicCanvas()
to get the current component name. But no way to do so right now from the plasmic-host
page itself; you could listen to and parse it out of location.hash
…
so i’ve added this to the standard [[…slug]]
page - i look for “products” in the url and fetch my shopify data for hydrogen
i didn’t want to have to wrap every page in a code component. maybe this is dumb of me