siddharth verma
siddharth verma

Reputation: 1

Type '{ params: { quesId: string; quesName: string; }; }' does not satisfy the constraint 'PageProps'

import { db, questionCollection } from "@/models/name";
import { databases } from "@/models/server/config";
import React from "react";
import EditQues from "./EditQues";

type tParams = Promise<{ quesId: string; quesName: string }>;

const Page = async (props: { params: tParams }) => {
  console.log(typeof props.params); // Now params is correctly typed as an object
  const { quesId } = await props.params;
  const question = await databases.getDocument(db, questionCollection, quesId);

  return <EditQues question={question} />;
};

[text](I have tried several ways but the error is still not going.)

Upvotes: -1

Views: 20

Answers (0)

Related Questions