Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
456 B

import React from "react";
interface ErrorPageProps {
statusCode: number
};
export default function Error(props: ErrorPageProps) {
return (
<p>
{props.statusCode
? `An error ${props.statusCode} occurred on server`
: "An error occurred on client"}
</p>
)
}
export const getInitialProps = ({ res, err }) => {
const statusCode = res ? res.statusCode : err ? err.statusCode : 404
return { props: { statusCode } };
};