在示例演示中使用布局时,获取“道具类型失败:提供给Layout的道具propBar无效”警告

时间:2019-06-03 00:50:41

标签: javascript reactjs react-admin

使用示例演示中的布局时,获得警告“道具类型失败:提供给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);

我希望没有警告消息。

0 个答案:

没有答案