Skip to content

Instantly share code, notes, and snippets.

@robbertvancaem
Created December 9, 2019 08:31
Show Gist options
  • Save robbertvancaem/71587c7b6b62e7c1cfad3b72a8f79820 to your computer and use it in GitHub Desktop.
Save robbertvancaem/71587c7b6b62e7c1cfad3b72a8f79820 to your computer and use it in GitHub Desktop.
dynamic-routing-now-6
// 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