Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
fix(type)!: Fix getLayout types
Browse files Browse the repository at this point in the history
  • Loading branch information
re-taro committed Dec 11, 2022
1 parent b3b9682 commit 327494d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/@types/next.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { NextPage } from "next";
import type { ReactElement } from "react";
import type { ReactElement, ReactNode } from "react";

declare module "next" {
type NextPageWithLayout<P = object, IP = P> = NextPage<P, IP> & {
getLayout?: (page: ReactElement) => ReactElement;
getLayout?: (page: ReactElement) => ReactNode;
};
}
2 changes: 1 addition & 1 deletion src/components/layout/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const EditLayout: FC<EditLayoutInterface> = ({ children, name }) => (

export const createGetLayout = (
layoutProps: EditLayoutProps,
): ((page: ReactElement) => ReactElement) =>
): ((page: ReactElement) => ReactNode) =>
function getLayout(page: ReactElement) {
return <EditLayout {...layoutProps}>{page}</EditLayout>;
};
2 changes: 1 addition & 1 deletion src/components/layout/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ViewLayout: FC<ViewLayoutInterface> = ({

export const createGetLayout = (
layoutProps: ViewLayoutProps,
): ((page: ReactElement) => ReactElement) =>
): ((page: ReactElement) => ReactNode) =>
function getLayout(page: ReactElement) {
return <ViewLayout {...layoutProps}>{page}</ViewLayout>;
};

0 comments on commit 327494d

Please sign in to comment.