[英]Remove (or at least hide) card on react-admin List
I want to get rid of the Card on the background react-admin's List (v3.4.2).我想摆脱后台 react-admin 列表(v3.4.2)上的卡片。 I get the desired effect if I define a string on the component property:
如果我在组件属性上定义一个字符串,我会得到想要的效果:
<List component={"some string"}/>
But this spams the console with an error:但这会向控制台发送错误消息:
And I don't want to have that error.而且我不想有那个错误。 On top of that, I think I shouldn't be changing the component property (I can't find it on the official docs).
最重要的是,我认为我不应该更改组件属性(我在官方文档中找不到它)。
The code should be the following: https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/list/List.js代码应如下所示: https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/list/List.js
How should I do this?我该怎么做? Is it possible to pass a style?
是否可以传递一种风格? Is there any component that works out of the box?
有没有开箱即用的组件? Or should I just go custom?
还是我应该只定制 go ?
You can hide the background using styling:您可以使用样式隐藏背景:
import { makeStyles } from '@material-ui/core/styles'
const useListStyles = makeStyles(theme => ({
content: {
boxShadow: 'none',
backgroundColor: 'inherit',
},
main: {
// backgroundColor: 'red',
},
root: {
// backgroundColor: 'red',
},
}))
const MyList = (props) => {
const classes = useListStyles()
return (
<List classes={classes} {...props} >
...
</List>
)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.