I have a component called DashboardLayout
, with prop definitions inferred from an interface LayoutProps
.
When I add new props to LayoutProps
, they don't show up in either a) the props variable or b) the dev tools. console.log-ing all keys of props show all previous props, but no new ones.
Adding new props to other components works.
Here is a minimal code example:
interface LayoutProps {
title: string;
slug: string;
sitemapLinks?: SitemapLink[];
translateTitle?: boolean;
modul?: ModuleBase;
}
const DashboardLayout: BlitzLayout<LayoutProps> = (props) => {
return (
<Suspense fallback="Loading...">
<UnsuspendedLayout {...props} />
<ReactTooltip />
</Suspense>
);
};
const adminModule = new AdministrationModule();
Admin.getLayout = (page) => (
<DashboardLayout
sitemapLinks={adminModule.generateSitemapLinks()}
slug={adminModule.name}
title={adminModule.title}
modul={adminModule}
>
{page}
</DashboardLayout>
);
The prop in question would be mod
.