This repository was archived by the owner on Jan 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +9
-11
lines changed
packages/e2e-tests/next-app-experimental/pages Expand file tree Collapse file tree 6 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 1
- export default function Custom404 ( ) {
1
+ export default function Custom404 ( ) : JSX . Element {
2
2
return < h1 > Custom 404</ h1 > ;
3
3
}
Original file line number Diff line number Diff line change 1
- export default function Custom500 ( ) {
1
+ export default function Custom500 ( ) : JSX . Element {
2
2
return < h1 > Custom 500</ h1 > ;
3
3
}
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
- import { NextPageContext } from "next" ;
3
2
4
3
type ErroredPageNewSsrProps = {
5
4
name : string ;
@@ -15,7 +14,7 @@ export default function ErroredPageNewSsr(
15
14
) ;
16
15
}
17
16
18
- export function getServerSideProps ( ctx : NextPageContext ) : {
17
+ export function getServerSideProps ( ) : {
19
18
props : ErroredPageNewSsrProps ;
20
19
} {
21
20
throw new Error ( "Error occurred!" ) ;
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
- import { NextPageContext } from "next" ;
3
2
4
3
type ErroredPageProps = {
5
4
name : string ;
@@ -14,7 +13,7 @@ export default function ErroredPageProps(props: ErroredPageProps): JSX.Element {
14
13
}
15
14
16
15
// getInitialProps() is the old way of doing SSR
17
- ErroredPageProps . getInitialProps = ( ctx : NextPageContext ) : ErroredPageProps => {
16
+ ErroredPageProps . getInitialProps = ( ) : ErroredPageProps => {
18
17
// Simulate a server-side error by always throwing an error.
19
18
throw new Error ( `Error occurred!` ) ;
20
19
} ;
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
- import { GetStaticPropsContext } from "next" ;
3
2
import Image from "next/image" ;
4
3
5
4
type ImageComponentProps = {
6
5
name : string ;
7
6
} ;
8
7
9
- export default function ImageComponentPage ( props : any ) : JSX . Element {
8
+ export default function ImageComponentPage (
9
+ props : ImageComponentProps
10
+ ) : JSX . Element {
10
11
return (
11
12
< React . Fragment >
12
13
{ `Hello ${ props . name } ! This is an SSG Page using getStaticProps() and with the new Image component.` }
@@ -20,7 +21,7 @@ export default function ImageComponentPage(props: any): JSX.Element {
20
21
) ;
21
22
}
22
23
23
- export function getStaticProps ( ctx : GetStaticPropsContext ) : {
24
+ export function getStaticProps ( ) : {
24
25
props : ImageComponentProps ;
25
26
} {
26
27
return {
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
- import { NextPageContext } from "next" ;
3
2
4
3
type SSRPageProps = {
5
4
name : string ;
@@ -14,6 +13,6 @@ export default function SSRPage(props: SSRPageProps): JSX.Element {
14
13
}
15
14
16
15
// getInitialProps() is the old way of doing SSR
17
- SSRPage . getInitialProps = ( ctx : NextPageContext ) : SSRPageProps => {
16
+ SSRPage . getInitialProps = ( ) : SSRPageProps => {
18
17
return { name : "serverless-next.js" } ;
19
18
} ;
You can’t perform that action at this time.
0 commit comments