I’m having a problem with some code components in Plasmic and I couldn’t find anything talking about it.
I need to pass some functions, by parameter, to a component.
The file “components/TestemonialSlider.tsx” imports a component from the file “components/plasmic/apoiase_home/PlasmicTestemonialSlider.tsx” and passes a parameter called “slideBullet” containing an object that has two functions and a number. The component “PlasmicTestemonialSlider” by in turn, import a component from the file “components/SlideBullet.tsx” and pass these parameters to this component.
The “SlideBullet” component is typed with the interface below:
I think I’ve found the reason for this. It happens when the base element of your Plasmic component is a component (e.g. code component) that doesn’t accept styles, and thus, the className prop.
So one workaround is the one I’ve posted above - change the generated code manually.
Another one: change your Plasmic component’s implementation so that its’ root element is some div that accept styles, for example.