Skip to content

Commit

Permalink
fix: Remove getInitialProps from custom error page
Browse files Browse the repository at this point in the history
  • Loading branch information
thasup committed Dec 8, 2024
1 parent 019663a commit 338b0ec
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions client/pages/404.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
import React from 'react';

function Custom404({ statusCode }) {
function Custom404() {
return (
<p
className="d-flex justify-content-center align-items-center"
style={{ height: '90vh' }}
>
{
statusCode === 404
? '404 Page not found X('
: 'Something went wrong. Please try again. :('
}
404 Page not found :(
</p>
);
}

Custom404.getInitialProps = ({ res, err }) => {
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
return { statusCode };
};

export default Custom404

0 comments on commit 338b0ec

Please sign in to comment.