Skip to content

Commit 91bef26

Browse files
Change Layout interface to use AppBarProps interface
Fixes #6019
1 parent 2ee2a98 commit 91bef26

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

packages/ra-ui-materialui/src/layout/AppBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ AppBar.defaultProps = {
190190

191191
export interface AppBarProps extends Omit<MuiAppBarProps, 'title' | 'classes'> {
192192
classes?: ClassesOverride<typeof useStyles>;
193-
logout?: JSX.Element;
193+
logout?: React.ReactNode;
194194
open?: boolean;
195195
title?: string | JSX.Element;
196196
userMenu?: JSX.Element | boolean;

packages/ra-ui-materialui/src/layout/Layout.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import React, {
66
useState,
77
ErrorInfo,
88
ReactElement,
9-
ReactNode,
109
ComponentType,
1110
HtmlHTMLAttributes,
1211
} from 'react';
@@ -24,7 +23,7 @@ import { ThemeOptions } from '@material-ui/core';
2423
import { ComponentPropType, CoreLayoutProps } from 'ra-core';
2524
import compose from 'lodash/flowRight';
2625

27-
import DefaultAppBar from './AppBar';
26+
import DefaultAppBar, { AppBarProps } from './AppBar';
2827
import DefaultSidebar from './Sidebar';
2928
import DefaultMenu, { MenuProps } from './Menu';
3029
import DefaultNotification from './Notification';
@@ -186,11 +185,7 @@ class LayoutWithoutTheme extends Component<
186185
export interface LayoutProps
187186
extends CoreLayoutProps,
188187
Omit<HtmlHTMLAttributes<HTMLDivElement>, 'title'> {
189-
appBar?: ComponentType<{
190-
title?: string | ReactElement<any>;
191-
open?: boolean;
192-
logout?: ReactNode;
193-
}>;
188+
appBar?: ComponentType<AppBarProps>;
194189
classes?: any;
195190
className?: string;
196191
error?: ComponentType<{

0 commit comments

Comments
 (0)