Getting this react export error:
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
I registered a code component that has a good amount of depth to it with other code components that aren’t registered. I’m under the impression I don’t need to register all the code components used in the one that is registered. Is that right? What else would be causing an export error being thrown?
correct, you only need to register components that are directly used in the studio
this error is thrown when a React component is rendering an object as its content… like <div>{oopsAnObject}</div>
… I’d recommend putting a breakpoint where the error is thrown (you should see it in the console) and seeing what the object actually is, and then figuring out what component is rendering it
ah, thanks for the point in the right direction!
we have a widely used pattern like
const Component = propComponent
so we can pass any component as a prop, then ‘convert’ it to a JSX component to use. Looks like plasmic already does that, so that pattern breaks