-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ceedefc
commit bc280d0
Showing
8 changed files
with
118 additions
and
66 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const statusFetch = { | ||
pending: "pending", | ||
resolved: "resolved", | ||
idle: "idle", | ||
found: "found", | ||
notfound: "notfound", | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { useEffect } from "react"; | ||
import { useRouter } from "next/router"; | ||
|
||
export default function Custom404() { | ||
const router = useRouter(); | ||
|
||
useEffect(() => { | ||
router.replace("/"); | ||
}); | ||
|
||
return null; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Document, { Html, Head, Main, NextScript } from "next/document"; | ||
|
||
class MyDocument extends Document { | ||
static async getInitialProps(ctx) { | ||
const originalRenderPage = ctx.renderPage; | ||
|
||
// Run the React rendering logic synchronously | ||
ctx.renderPage = () => | ||
originalRenderPage({ | ||
// Useful for wrapping the whole react tree | ||
enhanceApp: (App) => App, | ||
// Useful for wrapping in a per-page basis | ||
enhanceComponent: (Component) => Component, | ||
}); | ||
|
||
// Run the parent `getInitialProps`, it now includes the custom `renderPage` | ||
const initialProps = await Document.getInitialProps(ctx); | ||
|
||
return initialProps; | ||
} | ||
|
||
render() { | ||
return ( | ||
<Html lang="es"> | ||
<Head></Head> | ||
<body> | ||
<Main /> | ||
<NextScript /> | ||
</body> | ||
</Html> | ||
); | ||
} | ||
} | ||
|
||
export default MyDocument; |
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
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