nishimura.clubnishimura.club

MUI メモ

Mui Tooltip の padding 調整

theme で既に padding を Override しているが、さらに設定したい場合

const CancelPopper = styled(Popper)` & .${tooltipClasses.tooltip} { padding: 0px; &:hover { background-color: ${({ theme }) => theme.palette.grey[300]}; & .${tooltipClasses.arrow} { color: ${({ theme }) => theme.palette.grey[300]}; } } } `;
PopperComponent = { CancelPopper };

[object Object],props に ReactNode を追加できない

export type AlertProps = MuiAlertProps & { title: React.ReactNode; // 使用する時にtype errorになる description: React.ReactNode; };

divタグにはtitle属性があるので、Omitで取り除いてあげる

修正

export type AlertProps = Omit<MuiAlertProps, 'title'> & { title: React.ReactNode; description: React.ReactNode; };