Type error: Page "..." does not match the required types of a Next.js Page!
Answered
πππππ£πππ posted this in #help-forum
So,
I am getting this error when bulding the app:
Snippet:
I am getting this error when bulding the app:
Type error: Page "src/app/detailed_view/page.tsx" does not match the required types of a Next.js Page.
"CardDemo" is not a valid Page export field.Snippet:
type CardProps = React.ComponentProps<typeof Card>
export default function CardDemo({ className, ...props }: CardProps) {
const searchparams = useSearchParams()
const name = searchparams.get('name')24 Replies
you can't export CardDemo with that props type
Answer
how will you get Card types props in page.tsx?
thxx!!
no worries, it was simple problem
it's solved I assume?
noice, could you mark the message that helped you as solution?
🫑
Also...
It is offtopic from the main reason, but how can i use router in
cell function ?...
export const columns: ColumnDef<Payment>[] = [
{
accessorKey: "version",
header: "Package version",
},
{
accessorKey: "desc",
header: "Update notes",
},
{
id: "actions",
header: "Actions",
cell: ({ row }) => {
const paket = row.original
const router = useRouter();
const handleCopyPackagaName = (dependency) => {
navigator.clipboard.writeText(dependency)
.then(() => {
toast.success("Copied package name!")
})
.catch(error => {
toast.error("Failed to copy the package name...")
});
}
...create a new component/function for the actions component ig?
i'm very fresh in ts
you can create a new <Actions /> component
and in cell function,
return (
<Actions paket={paket} />
)hmm, okay
@πππππ£πππ Click to see attachment
yes, you need a component to use hooks, like I said create a new component
i would try
sure, ask here if you have any problems
can you share your file, and please create new #help-forum post. since this is a new discussions.