Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next-server/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export async function loadGetInitialProps<
C extends BaseContext,
IP = {},
P = {}
>(Component: NextComponentType<C, IP, P>, ctx: C): Promise<IP> {
>(Component: NextComponentType<C, IP, P>, ctx: C): Promise<IP | null> {
if (process.env.NODE_ENV !== 'production') {
if (Component.prototype && Component.prototype.getInitialProps) {
const message = `"${getDisplayName(
Expand Down
2 changes: 1 addition & 1 deletion packages/next/client/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function getRouter() {
export default singletonRouter as SingletonRouter

// Reexport the withRoute HOC
export { default as withRouter, WithRouterProps } from './with-router'
export { default as withRouter } from './with-router'

export function useRouter() {
return React.useContext(RouterContext)
Expand Down
4 changes: 1 addition & 3 deletions packages/next/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ declare module 'react' {
* `Page` type, use it as a guide to create `pages`.
*/
export type NextPage<P = {}, IP = P> = {
(props: P): JSX.Element | null
defaultProps?: Partial<P>
displayName?: string
(props: P): JSX.Element
/**
* Used for initial page load data population. Data returned from `getInitialProps` is serialized when server rendered.
* Make sure to return plain `Object` without using `Date`, `Map`, `Set`.
Expand Down