UNPKG

next-nested-layout

Version:

Utility to create persistent and nested lay-outs in next-js (without the app-directory)

18 lines (17 loc) 659 B
import React from "react"; declare const LayoutNesterSymbol: unique symbol; type LayoutProperties = { [LayoutNesterSymbol]: true; }; type Layout = (props: { children: JSX.Element; }) => JSX.Element | (JSX.Element & LayoutProperties); type ComponentWithLayout<T> = React.FC<T> & { getLayout: Layout; }; declare function Root<T extends JSX.IntrinsicAttributes>({ Component, pageProps, }: { Component: React.FC<T> | ComponentWithLayout<T>; pageProps: T; }): JSX.Element; declare function createLayout<T>(Component: React.FC<T>, Layout: Layout, Parent?: Layout): readonly [React.FC<T>, Layout]; export { Root, createLayout };