我想在Meterial ui的XGrid中自定义行颜色。这些行是从信号 R 更新的,我称之为 newRowComing。当 newRowComing 时,只是该行在间隔时间内闪烁,但我无法为该行设置样式。我只能用整个表格(网格)闪光。这是我的代码(整个网格闪烁,而不是 newRowComing)。 如果有人解决了问题,请给我解决方案。 非常感谢!
<Grid style={{ backgroundColor: isBlink ? 'yellow ' : 'white' }} item xs={12} className={contentRow}>
<XGrid
apiRef={apiRef}
columns={columns}
rows={chatData.map((x, i) => ({ ...x, id: i }))}
hideFooter
disableColumnSelector
onRowSelected={({ data }) => handleRowSelected({ ...data, id: data.Id })}
/>
</Grid>