使用示例演示中的布局时,获得警告“道具类型失败:提供给appBar
的道具Layout
无效。
我正在从https://github.com/marmelab/react-admin/tree/master/examples/demo的react-admin的演示项目代码中学习。我将Layout.js和AppBar.js复制到我自己的项目中,并对AppBar.js进行了一些修改。他们工作正常。但是,我看到一条警告“警告:道具类型失败:提供给appBar
的道具Layout
无效。”
// I remove Logo from AppBar
import { AppBar, UserMenu, MenuItemLink, translate } from 'react-admin';
import Typography from '@material-ui/core/Typography';
import SettingsIcon from '@material-ui/icons/Settings';
import { withStyles } from '@material-ui/core/styles';
// const styles = {...}
// const CustomUserMenu = ...
const CustomAppBar = ({ classes, ...props }) => (
<AppBar {...props} userMenu={<CustomUserMenu />}>
<Typography
variant="inherit"
color="inherit"
className={classes.title}
id="react-admin-title"
/>
<span className={classes.spacer} />
</AppBar>
);
export default withStyles(styles)(CustomAppBar);
我希望没有警告消息。