admin: {
user: Users.slug,
meta: {
titleSuffix: "- QS I-GAUGE",
icons: [
{
rel: "icon",
type: "image/svg",
url: "/favicon.svg",
},
],
defaultOGImageType: "static",
openGraph: {
images: [
{
url: "/logo.svg",
},
],
},
},
components: {
graphics: {
Logo: Logo,
Icon: Icon,
},
},
},const Logo = () => {
return (
<div className="logo">
<img src="/logo.svg" alt="Igauge" />
</div>
);
};
export default Logo;here is an example of what I tried to do which is pretty close to what the documentation suggests I believe but I get the error
TS2322: Type () => React. JSX. Element is not assignable to type
CustomComponent<Record<string, any>> | undefinedAny idea on how to fix this?
Hey
@1014589523247771679,
Payload v3 changed the way in which custom components get referenced in configs to allow more flexible and powerful patterns here, such as rendering them out on the server on demand.
In v3, to import a custom component, you're going to want to pass the path to your custom component instead of importing them into config.
Try this instead:
...
components: {
graphics: {
Logo: '/path/to/Logo',
Icon: '/path/to/Icon',
},
},See here:
https://payloadcms.com/docs/admin/components#defining-custom-componentsohh did not read on it, my bad will give it a try
also thanks for the response
My pleasure
Star
Discord
online
Get dedicated engineering support directly from the Payload team.