should work once you add it:
plasmic doesn’t actually know whether your code component takes in a className prop… it is assuming so
OK , i made the change and that build error is gone. so far so good
thank you!
@chungwu one more q. I have some key value metadata defined on this component:
Plasmic is correctly putting this into its generated code:
// app/components/plasmic/osito/PlasmicEmailWelcome.tsx
export const PlasmicEmailWelcome = Object.assign(
// Top-level PlasmicEmailWelcome renders the root element
makeNodeComponent("root"),
{
// Helper components rendering sub-elements
ositoEmailLayout: makeNodeComponent("ositoEmailLayout"),
ositoEmailButton: makeNodeComponent("ositoEmailButton"),
// Metadata about props expected for PlasmicEmailWelcome
internalVariantProps: PlasmicEmailWelcome__VariantProps,
internalArgProps: PlasmicEmailWelcome__ArgProps,
// Key-value metadata
metadata: { subject: "Welcome to Osito" }
}
);
But how do I actually access the metadata of a codegen component from code?
In headless mode I was able to do this:
const plasmicData = await PLASMIC.fetchComponentData(componentName);
const compMeta = plasmicData.entryCompMetas[0];.
const emailSubject = replaceVariables(compMeta.metadata.subject, componentProps);
what’s the equivalent of getting the comp metas in codegen mode?
(I guess I can just continue using the above method to get the compMetas, but I worry about it getting out of sync with the generated components somehow. Am I just being paranoid?)
hmm you could just reference it as PlasmicEmailWelcome.metadata
… or are you trying to access it from outside the “application code”, like in a build script etc?
Huh i thought I tried that and it didn’t work, but I will try again when I get back to my desk in a few hours. Thanks
Yep looks like EmailWelcome.metadata
doesn’t work but PlasmicEmailWelcome.metadata
does, thanks for the tip