Skip to content

Commit

Permalink
fix: Fix layout defaultProps warning
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Sep 20, 2024
1 parent ee78f02 commit 935765b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ type LayoutProps = {
headerHeight?: number;
};

const defaults = {
doc: false,
};

export const Layout: LayoutStatics & FC<PropsWithChildren<LayoutProps>> = (props) => {
const {children, doc, headerHeight = 0} = props;
const {children, doc, headerHeight = 0} = {...defaults, ...props};
let header, content, footer;

React.Children.forEach(children as ReactElement[], (child: ReactElement) => {
Expand Down Expand Up @@ -59,10 +63,6 @@ export const Layout: LayoutStatics & FC<PropsWithChildren<LayoutProps>> = (props

Layout.displayName = 'Layout';

Layout.defaultProps = {
doc: false,
};

Layout.Header = Header;
Layout.Content = Content;
Layout.Footer = Footer;

0 comments on commit 935765b

Please sign in to comment.