Created
December 9, 2019 08:31
-
-
Save robbertvancaem/71587c7b6b62e7c1cfad3b72a8f79820 to your computer and use it in GitHub Desktop.
dynamic-routing-now-6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pages/_error.js | |
import React from 'react'; | |
const Error = ({ statusCode }) => { | |
let errorMessage = 'An unexpected error occured'; | |
if (statusCode === 404) { | |
errorMessage = 'Page could not be found'; | |
} | |
return ( | |
<div> | |
<h1>Something went wrong</h1> | |
<p>{errorMessage}</p> | |
</div> | |
) | |
} | |
export default Error; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment