Can anyone explain why TypeScript is telling me this: Property 'dateTime' does not exist on type 'SSRPageProps'.ts(2339)
Looking at my code below, I have data-time typed.
import React from "react";
import axios from "axios";
import { GetServerSideProps } from "next";
export default function SSRPage({ dateTime }: SSRPageProps) {
return <main>{dateTime}</main>;
}
export const getServerSideProps: GetServerSideProps = async () => {
const res = await axios.get("https://worldtimeapi.org/api/ip");
return {
props: { dateTime: res.data.datetime },
};
};
interface SSRPageProps {
abbreviation: string;
client_ip: string;
datetime: string;
day_of_week: number;
day_of_year: number;
dst: boolean;
dst_from: string;
dst_offset: number;
dst_until: string;
raw_offset: number;
timezone: string;
unixtime: number;
utc_datetime: string;
utc_offset: string;
week_number: number;
}