I am having trouble with imports with a custom component. The custom component is under the components directory. It is registered in App.tsx. In the registration, it has an importPath of ‘./FakeComponent’ but when I reload the editor, insert the component, then do a plasmic sync, there is an error. It is in the imports for the Plasmic component that has the component. The import is import { FakeComponent } from “…/…/…/…/FakeComponent”;
The real value should be …/…/FakeComponent. In addition, it is using notation for a non-default function so the curly braces should not be there either. The function that defines the component is defined as import default FakeComponent in a file of the same name.
Hi, for registering components you should register the importPath
based on the root directory, instead of the where you are making the register call. For default export you can use the isDefaultExport
option while registering. This is better described in https://docs.plasmic.app/learn/code-components-ref/
Thanks, that worked!!