I encountered the following issue:
Error: Type '{ data: never; }' is not compatible with type 'IntrinsicAttributes & IProps'. The property 'data' does not exist on the type 'IntrinsicAttributes & IProps'.
import { useEffect, useState } from "react";
import { InfoQuiz } from './InfoQuiz';
interface IProps {
id: string; // Define the prop type for 'id'
}
export default function UserQuizData({ id }: IProps) {
const { user } = useUser();
const [quizData, setQuizData] = useState(null);
useEffect(() => {
if (user) {
const fetchUserQuizData = async () => {
const response = await fetch(`/api/user-quiz-data?id=${id}`, {
headers: {
Authorization: `Bearer ${user.publicMetadata.public_id}`,
},
});
const data = await response.json();
setQuizData(data);
};
fetchUserQuizData();
}
}, [user]);
return <>{quizData && <InfoQuiz data={quizData} />}</>;
}
Any assistance would be greatly appreciated.