I'm encountering issues with the data property.
interface Props {
params: { slug: string };
}
const Page = async ({ params }: Props) => {
const data: any = await getPage(params.slug);
// This section dynamically renders the appropriate organism (e.g., ContactUs or AboutUs etc...) within the PageComponent based on the dynamic route parameter.
const PageComponent = dynamic(() =>
import(`@/components/organisms/${data.slug}`).then(
(module) => module.default
)
);
return (
<div>
<PageComponent data={data} />
</div>
);
};
Error Type '{ data: any; }' is not assignable to type 'IntrinsicAttributes'. Property 'data' does not exist on type 'IntrinsicAttributes'.ts(2322) (property) data: any
The data functions correctly and logs as expected in my component, specifically in the contact-us component.
interface Props {
data: any;
}
export default function ContactUs({ data }: Props) {
console.log(data);
return <div>{}</div>;
}
How can I resolve this type error?